|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.tapestry5.corelib.base.AbstractField
org.chenillekit.tapestry.core.components.RatingField<T>
@Import(library={"../Chenillekit.js","Rating.js"},
stylesheet="Rating.css")
public class RatingField<T>This component provides the ability to associate a RadioGroup and its subordinate Radio fields with a set of values displayed as a rating scale. This is typified by the "star field" where grayed stars represent the choices and highlighted stars represent the chosen value and all values up to the chosen value from left to right.
This is in fact that default visual appearance. However, the images can be overridden via parameters and the entire component can, of course, be styled via CSS. As an added benefit, since the underlying representation is simply a RadioGroup with Radio fields it should degrade well when JS and/or CSS is disabled. This should keep the component rather accessible. By default the first value display image will be hidden as this typically will indicate no value.
| Constructor Summary | |
|---|---|
RatingField()
|
|
| Method Summary | |
|---|---|
void |
afterRender(MarkupWriter writer)
|
protected void |
configure(JSONObject options)
Invoked to allow subclasses to further configure the parameters passed to this component's javascript options. |
ValueEncoder |
getEncoder()
Returns an appropriate ValueEncoder implementation based on the value type. |
String |
getRadioLabel()
Returns a reasonable label for the radio value. |
Asset |
getSelectedImage()
Returns the image representing a selected value. |
Asset |
getUnselectedImage()
Returns the image representing an unselected value. |
protected void |
processSubmission(String elementName)
Method implemented by subclasses to actually do the work of processing the submission of the form. |
| Methods inherited from class org.apache.tapestry5.corelib.base.AbstractField |
|---|
createDefaultParameterBinding, decorateInsideField, getClientId, getControlName, getLabel, isDisabled, isRequired, putPropertyNameIntoBeanValidationContext, removePropertyNameFromBeanValidationContext, setDecorator, setFormSupport |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RatingField()
| Method Detail |
|---|
public Asset getUnselectedImage()
public Asset getSelectedImage()
public ValueEncoder getEncoder()
public String getRadioLabel()
protected void processSubmission(String elementName)
disabled.
processSubmission in class AbstractFieldelementName - the name of the element (used to find the correct parameter in the request)public void afterRender(MarkupWriter writer)
protected void configure(JSONObject options)
options - windows option object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||