wheel.components
Interface ISelectModel

All Known Subinterfaces:
IEnhancingSelectModel
All Known Implementing Classes:
DynamicSelectModel, StringSelectModel

public interface ISelectModel

Same as IPropertySelectionModel in Tapestry 4.x. Implementations of this interface are used to create html-presentable ways to select one (or many) objects from a collection of objects. How this works:
First the ISelectModel is used to render a set of <option> tags. (pseudo code)

 for (int i=0; i < selectModel.getOptioncount(); i++) {
      <option value="selectModel.getValue(i)">selectModel.getLabel(i)</option>
 }
 
When a form is submitted with the value from the selected option tag, its then translated to the selected object with a call to translateValue(valueFromFormSubmit);

Author:
Henri Frilund

Method Summary
 java.lang.String getLabel(int index)
          Returns the label to use in the html-presentation for a given index.
 java.util.Collection getObjects()
           
 int getOptionCount()
          Returns the total number of objects.
 java.lang.String getValue(int index)
          Returns the String value that identifies the object in a html form.
 java.lang.Object translateValue(java.lang.String value)
          Translates the given String value (from form submit) to the corresponding Object.
 

Method Detail

getOptionCount

int getOptionCount()
Returns the total number of objects.

Returns:

getLabel

java.lang.String getLabel(int index)
Returns the label to use in the html-presentation for a given index.

Parameters:
index -
Returns:

getValue

java.lang.String getValue(int index)
Returns the String value that identifies the object in a html form.

Parameters:
index -
Returns:

translateValue

java.lang.Object translateValue(java.lang.String value)
Translates the given String value (from form submit) to the corresponding Object.

Parameters:
value -
Returns:

getObjects

java.util.Collection getObjects()


Copyright © 2007-2008. All Rights Reserved.