RatingIndicator
Use
The RatingIndicator UI element enables you to visualize user ratings using icons on a scale. This UI element allows users to submit a rating for a topic using a mouse click or the arrow or number keys. You can also use it purely to display user ratings. For example, you can display how users, on average, have rated a Web page.
With property maxValue you can specify the range of values on the scale and the number of icons displayed.
Star shapes are the standard icons used for visualizing the rating. With properties emptyItemIconSource, fullItemIconSource, and hoverItemIconSource, you can replace these stars with icons from the SAP icon library or with your own icons.
With property displayMode you can specify how interim values are displayed.
Example of the Visual Display:
Implementation Details
| Runtime Class | CL_WD_RATINGINDICATOR |
Properties in View Designer
For more information, see RatingIndicator Properties.
| Name | Type | Initial Value | Bindable |
|---|---|---|---|
| id | STRING | (automatic) | No |
| contextMenuBehaviour | WDUI_CONTEXT_MENU_BEHAVIOUR | inherit | No |
| contextMenuId | WDY_MD_UI_ELEMENT_REFERENCE | No | |
| displayMode | WDUI_RATING_IND_DISPLAY_MODE | full | yes |
| emptyItemIconSource | STRING | Yes | |
| enabled | WDY_BOOLEAN | true | Yes |
| fullItemIconSource | STRING | Yes | |
| hoverItemIconSource | STRING | Yes | |
| maxValue | I | 5 | yes |
| readOnly | WDY_BOOLEAN | false | Yes |
| tooltip | Translatable text | Yes | |
| styleClassName | STRING | Yes | |
| value | F | 0 | yes |
| visible | WDUI_VISIBILITY | visible | Yes |
Events in View Designer
| Name |
|---|
| onRate |
Dynamic Programming
For dynamic programming, the same properties, events, and aggregations as in the View Designer are available. But note that the spelling format and use of upper/lower case is different.
Dynamic Programming of Properties
| View Designer Name |
Runtime Name |
Type |
|---|---|---|
|
CONTEXT_MENU_BEHAVIOUR |
WDUI_CONTEXT_MENU_BEHAVIOUR |
|
| contextMenuBehaviour: inherit | CL_WD_RATINGINDICATOR=>E_CONTEXT_MENU_BEHAVIOUR-INHERIT | |
| contextMenuBehaviour: provide | CL_WD_RATINGINDICATOR=>E_CONTEXT_MENU_BEHAVIOUR-PROVIDE | |
| contextMenuBehaviour: suppress | CL_WD_RATINGINDICATOR=>E_CONTEXT_MENU_BEHAVIOUR-SUPPRESS | |
|
CONTEXT_MENU_ID |
WDY_MD_UI_ELEMENT_REFERENCE |
|
| displayMode |
DISPLAY_MODE |
WDUI_RATING_IND_DISPLAY_MODE |
|
displayMode: continuous |
CL_WD_RATINGINDICATOR=>E_DISPLAY_MODE-CONTINUOUS |
|
|
displayMode: full |
CL_WD_RATINGINDICATOR=>E_DISPLAY_MODE-FULL |
|
|
displayMode: half |
CL_WD_RATINGINDICATOR=>E_DISPLAY_MODE-HALF |
|
| emptyItemIconSource |
EMPTYITEMICONSOURCE |
STRING |
|
ENABLED |
WDY_BOOLEAN |
|
| fullItemIconSource |
FULLITEMICONSOURCE |
STRING |
| hoverItemIconSource |
HOVERITEMICONSOURCE |
STRING |
| maxValue |
MAX_VALUE |
I |
| readOnly |
READ_ONLY |
WDY_BOOLEAN |
| styleClassName | STYLE_CLASS_NAME | STRING |
|
TOOLTIP |
WDY_MD_TRANSLATABLE_TEXT |
|
| value | VALUE | F |
|
VISIBLE |
WDUI_VISIBILITY |
|
| visible: none | CL_WD_RATINGINDICATOR=>E_VISIBLE-NONE | |
|
visible: visible |
CL_WD_RATINGINDICATOR=>E_VISIBLE-VISIBLE |
|
Dynamic Programming of Events
| View Designer Name | Runtime Name |
|---|---|
| onRate | ON_RATE |