Decorators
Decorators can be added to non-generic table columns to conditionally override the value of a column or the default display settings of the system. The list of existing decorators of a column appears within that column on the Queries & Reports page, beneath that column's format / value box.
Each decorator appears as a box listing its key details, above which are buttons to edit or delete that decorator. At the bottom of the list lies the "Add Decorator" button, which brings up the following panel to add a new decorator; the edit button brings up an identical panel that is already populated with the fields of the selected decorator.
The Display Field
The "Display" field contains a condition that dictates when the system will apply the settings of the decorator to its parent column.
By default, a decorator of any column type is always active, hence the Always condition type in the above screenshot.
Decorators of any column type can also use the If expression is true condition type, which allows the user to provide an EL expression or variable, and the decorator will be applied in the column for all rows where the variable or expression evaluates to true. Beyond these two, however, the types of conditions a user can set for the Display field depend on the type of the decorator's parent column.
Text columns enabled the If value equals condition type; when selected, the user inputs a string Equals Value, and the system will apply the decorator to the column for all rows with a value matching the supplied string.
Number, Bar, and Icon columns all enable three condition types:
- If value is less than, for which the system applies the decorator when the value of the column is less than a supplied upper bound
- If value is greater than, where the user inputs a lower bound, and the system applies the decorator when the value of the column is greater than the lower bound
- If value is in range, for which the user supplies both a lower and upper bound, and the decorator is active for all rows with a value for the column between those bounds.
Icon-type columns can also contain fields with the Text data type; if any of these three condition types is used when the column contains a Text-type value, they will always evaluate to true.
A non-generic column can have any number of decorators, and as a result, multiple decorators for the same column can have their conditions evaluate to true simultaneously. In this case, the first decorator in the list that evaluates to true will be applied, and no others.
Other Decorator Fields
The "Display" field controls when a decorator is applied to a column value, but a decorator contains many other fields that control which settings of the column are changed when the decorator is applied. The following fields can be set for decorators of all non-generic column types:
- The Text Color field allows the user to choose the color of the text displayed in the column; clicking on the text color box opens a popup where the user can select any color on a spectrum or enter a hex color code.
- The Text Style Class field applies a predefined CSS class to the text displayed on the report; this field is only useful to users with access to the CSS files of the platform's source code, so most users can ignore it. The "Alignment" field controls whether the text is aligned to the left, right, or center of its cell on the table at runtime.
- The Bold and Italic flags make the text appear as bold or italicized, respectively, and the "Hidden" flag hides the value of the column when the decorator is applied.
- The Value field allows the decorator to override the Value field of its parent column when it is applied.
- The Export Value field overrides the parent column's Value field only when the report is exported to a PDF, not when the report appears on the application itself.
Decorators of an Icon-type column have three additional fields: the "Icon Value" field overrides the parent column's "Default Icon" field, and the "Icon Width" and "Icon Height" fields similarly override their counterparts of the parent column.