Label Positioning

The 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 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:

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 causeway.applib.annotation.property-layout.label-position configuration property:

application.properties
causeway.applib.annotation.property-layout.label-position=TOP

or

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.