Label Positioning
The labelPosition() element determines the positioning of labels for parameters.
The positioning of labels is typically LEFT, but can be positioned to the TOP.
The one exception is multiLine() string parameters, where the label defaults to TOP automatically (to provide as much real-estate for the multiline text field as possible).
For boolean parameters 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:
public class Order {
public Order changeStatus(
OrderStatus newStatus,
@Nullable
@ParameterLayout(
labelPosition=LabelPosition.TOP
)
String reason) {
// ...
}
// ...
}
Default settings
If you want a consistent look-n-feel throughout the app, eg all parameter labels to the top, then it’d be rather frustrating to have to annotate every parameter.
Instead, a default can be specified using the causeway.applib.annotation.parameter-layout.label-position configuration property:
causeway.applib.annotation.parameter-layout.label-position=TOP
or
causeway.applib.annotation.parameter-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.