|
|||||||||
| Home >> All >> org >> apache >> tapestry >> [ form overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.tapestry.form
Interface IPropertySelectionModel

- All Known Implementing Classes:
- EnumPropertySelectionModel, StringPropertySelectionModel
- public interface IPropertySelectionModel
Used by a PropertySelection to provide labels for options.
The component requires three different representations of each option:
- The option value, a Java object that will eventually be assigned to a property
- The label, a String which is incorprated into the HTML to identify the option to the user
- The value, a String which is used to represent the option as the value of the <option> or <input type=radio> generated by the PropertySelection.
The option is usually either an org.apache.commons.lang.enum.Enum (see EnumPropertySelectionModel) or some kind of business object. The label is often a property of the option object (for example, for a list of customers, it could be the customer name).
It should be easy to convert between the value and the option. It may simply be an index into an array. For business objects, it is often the primary key of the object, expressed as a String.
| Method Summary | |
java.lang.String |
getLabel(int index)
Returns the label for an option. |
java.lang.Object |
getOption(int index)
Returns one possible option. |
int |
getOptionCount()
Returns the number of possible options. |
java.lang.String |
getValue(int index)
Returns a String used to represent the option in the HTML (as the value of an <option> or <input type=radio>. |
java.lang.Object |
translateValue(java.lang.String value)
Returns the option corresponding to a value. |
| Method Detail |
getOptionCount
public int getOptionCount()
- Returns the number of possible options.
getOption
public java.lang.Object getOption(int index)
- Returns one possible option.
getLabel
public java.lang.String getLabel(int index)
- Returns the label for an option. It is the responsibility of the
adaptor to make this value localized.
getValue
public java.lang.String getValue(int index)
- Returns a String used to represent the option in the HTML (as the
value of an <option> or <input type=radio>.
translateValue
public java.lang.Object translateValue(java.lang.String value)
- Returns the option corresponding to a value. This is used when
interpreting submitted form parameters.
|
|||||||||
| Home >> All >> org >> apache >> tapestry >> [ form overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC