=== Label Positioning

:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
:page-partial:


The xref:refguide:applib:index/annotation/PropertyLayout.adoc#labelPosition[labelPosition()] element determines the positioning of labels for properties.

The positioning of labels is typically `LEFT`, but can be positioned to the `TOP`.
The one exception is xref:refguide:applib:index/annotation/PropertyLayout.adoc#multiLine[multiLine] string properties, where the label defaults to `TOP` automatically (to provide as much real-estate for the multiline text field as possible).

For boolean properties a positioning of `RIGHT` is also allowed; this is ignored for all other types.

It is also possible to suppress the label altogether, using `NONE`.

For example:

[source,java]
----
import lombok.Getter;
import lombok.Setter;

public class ToDoItem {

    @PropertyLayout(
        labelPosition=LabelPosition.TOP
    )
    @Getter @Setter
    private String description;

    // ...
}
----

==== Default settings

If you want a consistent look-n-feel throughout the app, eg all property labels to the top, then it'd be rather frustrating to have to annotate every property.

Instead, a default can be specified using the xref:refguide:config:sections/causeway.applib.adoc#causeway.applib.annotation.property-layout.label-position[causeway.applib.annotation.property-layout.label-position] configuration property:

[source,ini]
.application.properties
----
causeway.applib.annotation.property-layout.label-position=TOP
----

or

[source,ini]
.application.properties
----
causeway.applib.annotation.property-layout.label-position=LEFT
----

If these are not present then the framework will render according to internal defaults.
At the time of writing, this means labels are to the left for all datatypes except multiline strings.


