Set hint
See also: Validators
Actions – Abstract
The action Set hint sets a specific Hint (text) and an Indicator (color) for a suitable Target element.
The action Set hint sets a specific Hint (text) and an Indicator (color) for a suitable Target element.
►IMPORTANT◄ Characteristics set for Hint and Indicator are overridden at runtime by calculation errors, system-dependent hints (e.g. for required fields) or Validators configured for the element.
A Target element must be linked so that the action Set hint can be selected under Action type.
Whether a linked Target element effectively supports corresponding features depends on its type and state at runtime ('Active', 'Visible', etc.).
The Hint text can be determined by two different methods:
The globe icon can be used to set a reference to a localization entry, which is then resolved at runtime by Localization or Company specific localization adaptations to match the locale of the session.
Alternatively, texts or Calculation expression can be assigned directly. This must be done for each supported Locale, even if the content is identical for all locales.
The Indicator defines a color value for the text and frame from a predefined selection of signal colors, which can be adjusted by Styles if necessary:
Indicator |
Appearance (Example: combobox with display type 'Options') |
Styles property |
(none) |
|
(none) |
success |
successColor |
|
warn |
warnColor |
|
error |
errorColor |
|
invalid |
||
primary |
primaryColor |
|
secondary |
secondaryColor |
The appearance is demonstrated here using a combobox with the display type 'Options', which offers the options for the Indicator for selection and, when selected, executes Set hint with the respective Indicator and its name as the Hint.
The options Set hint and Set indicator control whether the respective characteristic is to be changed at all by the action. If necessary, the characteristics (Hint and Indicator) can also be set independently of each other so that existing assignments are not overwritten.
Both options are selected by default.
Configuration details appear only for selected options.
Selecting an option (Set hint or Set indicator) without specifying any configuration details sets the 'default state' for the corresponding feature of the target element (no text or indicator color).
Examples
Simple use case example: 'Repdigit number'
If an integer calculation result (here 'Sum') produces a value that uses only identical numbers (except 0), a ' ►Repdigit number◄' hint should be displayed below the element.
Runtime example:
Configuration:
|
For the Sum Text field', which is a calculation field that determines the sum to be checked, the behaviour shown on the left is configured:
|
Demonstration example (see above)
The configuration used to create the screenshot in the 'Appearance' column above should serve as an example for the application.
The basis is a Combobox element that offers the following key values for selection via a data service for 'static values':
colornames.success
colornames.warn
colornames.error
colornames.invalid
colornames.primary
colornames.secondary
These values refer to the Resource name of the respective option for the Indicator that is localized in the lobsterui Bundle in the language management.
|
For the Combobox element, the behaviour shown on the left is configured to set the 'success' Indicator exactly when the user selects the 'success' option with the key value colornames.success:
►NOTE◄ According to the same pattern, a separate behaviour must be created for each additional type of Indicator. The Input parameter in the Behaviour type and the Indicator assigned in the action Set hint must be adjusted. The Hint, on the other hand, can be calculated appropriately from $input, since suitable key values have been stored. |
Dynamic formatting of elements in a 'data series'
In a Repeatable element container, any set of integer 'Numbers' can be entered as a data series. Each time a value is entered or changed, the following evaluations should be carried out and immediately visualized:
|
|
Configuration:
In principle, every change to a 'Number' in the data series can cause a new situation for the aggregation values 'Minimum', 'Maximum' and 'Average'. Therefore, the 'formatting' of all 'Number' elements must be updated whenever a single value is changed.
This requires a chain of behaviour with three stages:
|
The first stage of the chain is the behaviour shown on the left ('changed'), which is intended to trigger the update of all hints for elements of the data series if a single value is changed:
|
|
As the second step in the chain, the 'changed' behaviour shown on the left triggers a check of all hint types for all instances of the contained 'Number' element for the parent Repeatable element container:
|
|
The third step is to configure the behaviors shown on the left for the 'Number' Text field in the Repeatable element container, of which only ('belowAverageHint') will be discussed in more detail here. This behaviour controls whether the value of the executing element is marked as 'below average' or not.
►NOTE◄ If several test criteria apply to the same 'Number', they are applied according to the order of the behaviour called in the second stage. For example, the 'minimumHint' almost always overrides the 'belowAverageHint', unless all numbers in the data series are identical. But then the 'minimum' is also equal to the 'maximum', so that the 'maximumHint' appears. If several individual values correspond to the minimum or maximum value, the relevant hint appears several times. |