UI Components

Additional Binding

Tooltips

For displaying tooltips on UI elements linkki provides the annotation @BindTooltip. This annotation can be added in the PMO binding to the method to which the UI element is bound. In the case of binding using the @Bind annotation, @BindTooltip must be written directly in the field annotated with @Bind.

The @BindTooltip annotation has two properties:

Value

This is the text displayed on TooltipType.STATIC. Its default value is an empty string ("").

TooltipType

The following configuration options are available for TooltipType:

Table 1. TooltipType

STATIC

the text of the tooltip is read from the attribute value (default)

DYNAMIC

the text of the tooltip is determined by the return value of the method String get<PropertyName>Tooltip(). The value is ignored.

Tooltips can only be added to fields and buttons.
    @UITableColumn(width = 50)
    @BindTooltip("Edit")
    @UIButton(position = 30, icon = FontAwesome.EDIT, showIcon = true)
    public void edit() {
        editAction.accept(contact);
    }

Bind read-only state

To change a components read-only behavior, linkki provides the annotation @BindReadOnly. This annotation can be used in combination with @Bind or UI-annotations.

The @BindReadOnly annotation must be placed after @Bind or @UI-annotations as the read-only state might have already be affected by these annotations.
This annotation should be used only in exceptional cases, since most of the behavior is better controlled by PropertyBehavior.

The @BindReadOnly Annotation has only one Property, ReadOnlyType. Per Default, ReadOnlyType#ALWAYS is selected. Following ReadOnlyType are available:

Table 2. ReadOnlyType

ALWAYS

the component is always read-only (default)

DYNAMIC

the read-only behavior of the component is determined by the return value of the method is<PropertyName>ReadOnly()

DERIVED

behavior as it would be without this annotation