|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The SelectableGroup uses an OptionList for the storage of the options collection. The concrete subclasses (RadioButtonGroup, ListBox, ComboBox) implement the details of leveraging the option list in order to generate their respective HTML.
The SelectableGroup also supports a value added feature call "Label for None Selected". One can think of the "Label for None Selected" as a "reserved" option which is selected automatically when no other options are selected. While the label for none selected may be set programatically, the value is fixed to the empty string constant.
Not all SelectableGroups need supply an option for "None Selected".
This is a value added feature.
Note, that the None Selected option is never actually added to the OptionList.
It is merely automatically, prepended as needed to the overall HTML string.
If the label for none selected (see setLabelForNoneSelected is blank or null,
then no extra option is added.
If the label for none selected is a greater than 0 length string, then
it will be prepended to the list of options at the time the HTML is generated.
Special Note re: SelectableGroup/OptionList instance relationship. Clients of a SelectableGroup must be aware of the instance to instance relationship between a SelectableGroup and its OptionList. Specifically, in order to maximize runtime performance, clients may supply the same reference to a statically defined OptionList to many non staticly defined SelectableGroups.
By doing so, the cost of populating the OptionList can be reduced to a single static initialization.
This strategy is optimal for those situations where all run time instances of the specific SelectableGroup are intended to render the exact same list of options, for the entire life time of the SelectableGroup.
The drawback is that the since the same set of options are referrenced by all instances of SelectableGroup that have been affiliated with that single static instance of OptionList. clients must be careful not to adjust the OptionList, after its initial population.
If one wishes to have the Options vary from instance to instance of a given SelectableGroup then one should affiliate a non-static instance of OptionList with each instance of SelectableGroup. If that is done, when the content of a given OptionList instance is modified, only one SelectableGroup instance is affected.
Option
,
OptionList
,
RadioButtonGroup
,
ListBox
,
ComboBox
Field Summary | |
static java.lang.String |
VALUE_FOR_NONE_SELECTED
|
Fields inherited from interface com.iplanet.jato.view.html.HtmlDisplayField |
QBE_CONTROL_NAME_SUFFIX |
Fields inherited from interface com.iplanet.jato.view.View |
QUALIFIED_VIEW_NAME_SEPARATOR |
Method Summary | |
java.lang.String |
getLabelForNoneSelected()
Returns the raw "Label for None Selected" string. |
java.lang.String |
getNoneSelectedHtmlString(boolean noneSelected)
Returns the HTML string defining an Option consisting of the "Label for None Selected" label, and the predefined VALUE_FOR_NONE_SELECTED |
int |
getNumOptions()
Returns the number of Option objects currently in the option list |
OptionList |
getOptions()
Returns the OptionsList object |
boolean |
isMultiSelect()
Returns true if the SelectableGroup supports selection of more than one option |
boolean |
isSelected(Option option)
Returns true if the supplied Option is amongst the currently selected Options. |
boolean |
isSelected(java.lang.String value)
Returns true if the supplied value is amongst the currently selected option values |
void |
setLabelForNoneSelected(java.lang.String labelForNoneSelected)
Sets the raw "Label for None Selected" string. |
void |
setMultiSelect(boolean isMultiSelect)
Sets the multiple selection capability for the SelectableGroup |
void |
setOptions(OptionList value)
Sets the OptionsList object |
Methods inherited from interface com.iplanet.jato.view.html.HtmlDisplayField |
getExtraHtml |
Methods inherited from interface com.iplanet.jato.view.DisplayField |
getDescriptor, getValue, getValues, setValue, setValues, stringValue |
Methods inherited from interface com.iplanet.jato.view.View |
getName, getParent, getQualifiedName, setParent |
Field Detail |
public static final java.lang.String VALUE_FOR_NONE_SELECTED
Method Detail |
public boolean isMultiSelect()
public void setMultiSelect(boolean isMultiSelect)
isMultiSelect
- Determines whether this selectable group supports selection
of more than one option at a timepublic int getNumOptions()
public OptionList getOptions()
public void setOptions(OptionList value)
options
- the OptionsList objectpublic java.lang.String getNoneSelectedHtmlString(boolean noneSelected)
noneSelected
- if true, the "None Selected" option is selectedpublic java.lang.String getLabelForNoneSelected()
public void setLabelForNoneSelected(java.lang.String labelForNoneSelected)
labelForNoneSelected
- the raw "Label for None Selected" stringpublic boolean isSelected(java.lang.String value)
value
- The value to be compared with any currently selected
option valuespublic boolean isSelected(Option option)
Note - this does not perform an equivalency between the Option instance passed
in as an argument and the currently selected options(s).
Rather, it compares the value component of the Option parameter with the value
component of the currently selected options(s).
option
- The Option to be compared with any currently selected option Options
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |