Rating
What is the Form Rating?
The Rating field lets the user express a sentiment by picking one of five levels, rendered as stars, emoticons, or hand signals.
The stored value is a number from 1 (lowest) to 5 (highest), or 0 when nothing is selected.
Options
Input style
Specifies how the five rating levels are drawn. Possible values:
- Stars: Five stars that fill up to the selected level. Filled stars use the Stars Color.
- Emoticons: Five face icons, one per level, from a sad face (Very Bad) to a happy face (Very Good).
- Hand Signals: Five hand icons, one per level, from thumbs down (Very Bad) to thumbs up (Very Good).
Default: Stars.
Default selection
The level that is preselected when the field first renders, when no value is supplied by a datasource. Possible values:
- None (stored value
0) - Very Bad (stored value
1) - Bad (stored value
2) - Neutral (stored value
3) - Good (stored value
4) - Very Good (stored value
5)
Default: None.
Colors
Each level has its own color, plus a bar background and a stars color. Unselected icons are shown in light gray.
- Background Color: The background color of the rounded rating bar. Default:
#00a5fe. - Stars Color: The fill color of the selected and filled stars. It is used only by the Stars style. Default:
#FBE600. - Very Bad Color: The fill color of the level 1 icon when it is selected or hovered. Used by the Emoticons and Hand Signals styles. Default:
#ef2a10. - Bad Color: The fill color of the level 2 icon when it is selected or hovered. Used by the Emoticons and Hand Signals styles. Default:
#E58400. - Neutral Color: The fill color of the level 3 icon when it is selected or hovered. Used by the Emoticons and Hand Signals styles. Default:
#E8D600. - Good Color: The fill color of the level 4 icon when it is selected or hovered. Used by the Emoticons and Hand Signals styles. Default:
#00CC4F. - Very Good Color: The fill color of the level 5 icon when it is selected or hovered. Used by the Emoticons and Hand Signals styles. Default:
#006dd9.
In the Stars style the per-level sentiment colors are not used; selected and filled stars use the Stars Color instead.
Setting Mock Field and Own Value
The Rating stores its value as a number: 0 for no selection, or 1 to 5 for the chosen level. It updates the Mock and Own values when:
- The widget is rendered (using the datasource value if present, otherwise the configured Default selection).
- A level is clicked. Clicking the already selected level deselects it and stores
0. - An external message tells it to change, clear, or reset.
Exporting only happens on the displayer. It also broadcasts the value as a sensor event named after the field (see Sensor Events), unless the update is silent.
Validation
The Rating does not validate itself.
Sensor Events
-
The Rating does not validate, so it does not send a
{FORM-NAME}-validevent. -
Whenever the value is exported, the field broadcasts a sensor event named after the field, carrying the current numeric level:
{FORM-NAME} value: [0-5]This broadcast is suppressed when the change comes from a silent Clear or Reset.
External Messages
The Rating listens to the three basic external messages:
- Set Form: Reads the
valueparameter as a sentiment key (veryBad,bad,neutral,good,veryGood, ornone) and selects the matching level. Updates the Mock and Own values. - Clear Form: Clears the selection to None (stored value
0). Updates the Mock and Own values silently. - Reset Form: Restores the configured Default selection. Updates the Mock and Own values silently.
Value from Datasource
- When the field is rendered, if the bound form output datasource already holds a value for this field, that number selects the matching level:
1Very Bad,2Bad,3Neutral,4Good,5Very Good. Any other value selects None.