inputRating
Shows a rating star component with the current rating and allow the user to cast a vote.
This tag can be used to display a rating result by using its total and numVotes attributes or a concrete vote using its name attribute. If the latest, an input field will be rendered.
It is responsibility of the application developer to disable this tag if the user has already voted. The javascript library will disable the voting system only once, if the user revisits the page a new vote could be sent.
Tag Information | |
---|---|
Tag Class | org.loom.addons.rating.InputRatingTag |
Body Content | scriptless |
Dynamic Attributes | true |
Example | <a:inputRating id="vote" name="vote" total="${action.total}" numVotes="${action.numVotes}"/> <script>new loom.ui.Rating($('vote'));</script> |
Attributes
Name | Description | Flags |
---|---|---|
accesskey | HTML attribute |
rtexprvalue
|
alt | HTML attribute |
rtexprvalue
|
bound | true if this field is bound to a java property, defaults to true |
rtexprvalue
|
class | HTML attribute |
rtexprvalue
|
decorator | The name of the decorator to use. The default decorators for any form field will display the surrounding label. |
rtexprvalue
|
dir | HTML attribute |
rtexprvalue
|
disabled | HTML attribute |
rtexprvalue
|
escapeHTML | true to sanitize HTML characters when rendering as text, default true |
rtexprvalue
|
excludeMax | Set to true to make the maximum vote value inclusive (default true) |
rtexprvalue
|
excludeMin | Set to true to make the minimum vote value exclusive (default false) |
rtexprvalue
|
helpLine | If not null, this value will be used as help line |
rtexprvalue
|
id | HTML attribute |
rtexprvalue
|
if | Set to false to skip tag execution. |
rtexprvalue
|
keyProperty | the property of each options value that will be used as key, default 'id'
|
rtexprvalue
|
label | If not null, the provided value will be used as field label. Defaults to the name attribute |
rtexprvalue
|
labelClass | CSS styles to be applied to the surrounding label but not to the input component. This is useful when using grid systems such as 960gs or YUI-Grid |
rtexprvalue
|
labelPos | Position of the label for this field. Valid values are "left" (default for almost all field types) and "right" (default for checkboxes and radio buttons) |
rtexprvalue
|
labelProperty | the property of each options value that will be used as label, default 'name'
|
rtexprvalue
|
lang | HTML attribute |
rtexprvalue
|
maxValue | The maximum vote value.
If this value is specified, the list of options will be automatically calculated.
If there is a NumberValidation annotation, this field is automatically calculated |
rtexprvalue
|
minValue | The minimum vote value.
If this value is specified, the list of options will be automatically calculated
If there is a NumberValidation annotation, this field is automatically calculated |
rtexprvalue
|
multiple | HTML attribute |
rtexprvalue
|
name | If unspecified, this tag will be used to display a read-only value |
rtexprvalue
|
numVotes | The number of votes received, null for none. |
rtexprvalue
|
options | An Iterable with the available option values. If the Iterable contents are instances of Option, they will be used as is. Otherwise, labelProperty and keyProperty will be used to retrieve the labeland key properties, respectively. This attribute can be combined with nested <option> tags |
rtexprvalue
|
optionsComparatorClass | the Comparator class used to sort the options, null for none, default to LabelComparator |
rtexprvalue
|
renderAsText | true to render the field just as text (no form field), default false |
rtexprvalue
|
renderErrorDisplayComponent | true to render the error message as a separate HTML component, default null |
rtexprvalue
|
renderLabel | true to render label, false otherwise. By default it will use the value specified in the container form |
rtexprvalue
|
renderRatingText | true to render the current rating value as text, default true |
rtexprvalue
|
scale | the number of decimal digits to apply when calculating the average, default 1 |
rtexprvalue
|
size | HTML attribute |
rtexprvalue
|
sortBy | The method to apply for sorting options. Possible values are "none", "value" and "label" (default) |
rtexprvalue
|
style | HTML attribute |
rtexprvalue
|
tabindex | HTML attribute |
rtexprvalue
|
title | HTML attribute |
rtexprvalue
|
total | the aggregated sum of all votes, null if none |
rtexprvalue
|
translateLabel | true to translate label before rendering, false otherwise. defaults to true |
rtexprvalue
|
translateLabels | true to translate option labels, default true |
rtexprvalue
|
translateTitle | set to true to translate title, default true |
rtexprvalue
|
value | when specified, use this value instead of the action property value |
rtexprvalue
|