This tag renders an OrderableList component. Use this component
when web application users need to create and modify a list of
strings. The application user can add new strings by typing them
into the textfield and clicking the "moveUp" button, and remove them
by selecting one or more items from the list and clicking the
"Remove" button.
Configuring the listbox tag
Use the list attribute to bind the component
to a model. The value must be an EL expression that corresponds to
a managed bean or a property of a managed bean, and it must
evaluate to an array of java.lang.String.
To set the label of the textfield, use the
fieldLabel attribute. To set the label of the
textfield, use the listLabel attribute. To validate
new items, use the fieldValidator attribute; to
validate the contents of the list once the user has finished
adding and removing items, specify a labelValidator.
Facets
fieldLabel: use this facet to specify a custom
component for the textfield label.
listLabel: use this facet to specify a custom
component for the textfield label.
field: use this facet to specify a custom
component for the textfield.
moveUpButton: use this facet to specify a custom
component for the moveUp button.
removeButton: use this facet to specify a custom
component for the remove button.
search: use this facet to specify a custom
component for the search button.
readOnly: use this facet to specify a custom
component for display a readonly version of the component.
header: use this facet to specify a header,
rendered in a table row above the component.
footer: use this facet to specify a header,
rendered in a table row below the component.
Return true if the new value is different from the
previous value.
This only implements a compareValues for value if it is an Array.
If value is not an Array, defer to super.compareValues.
The assumption is that the ordering of the elements
between the previous value and the new value is determined
in the same manner.
Another assumption is that the two object arguments
are of the same type, both arrays of both not arrays.
Parameters: previous - old value of this component (if any) Parameters: value - new value of this component (if any)
Enforce non null values.
This is ok, since Converter returns null on null input.
And secondly this is equivalent to SelectItem and therefore
Option which do not allow null values.
However we have to be wary of values that are "".
But if the null case is out of the way the this should
work ok.
Retrieve the value of this component (the "selected" property) as an
object. This method is invoked by the JSF engine during the validation
phase. The JSF default behaviour is for components to defer the
conversion and validation to the renderer, but for the Selector based
components, the renderers do not share as much functionality as the
components do, so it is more efficient to do it here.
Parameters: context - The FacesContext of the request Parameters: submittedValue - The submitted value of the component
Gets or creates a component for the list label. Retrieves the
listLabel facet if one was specified, or creates a new label component.
A UIComponent for the list label
Retrieve an Iterator of ListSelector.ListItem, to be used by the
renderer.
an Iterator over ListItem. throws: javax.faces.FacesException -
getMoveBottomButtonComponent
public UIComponent getMoveBottomButtonComponent(FacesContext context)(Code)
Get or create the MOVEBOTTOM button. Retrieves the component specified by the
moveBottomButton facet (if there is one) or creates a new Button component.
A UI Component for the Move Bottom button
getMoveDownButtonComponent
public UIComponent getMoveDownButtonComponent(FacesContext context)(Code)
Get or create the MOVEDOWN button. Retrieves the component specified by the
moveDownButton facet (if there is one) or creates a new Button component.
A UI Component for the MOVEDOWN button
getMoveTopButtonComponent
public UIComponent getMoveTopButtonComponent(FacesContext context)(Code)
Get or create the MOVETOP button. Retrieves the component specified by the
moveTopButton facet (if there is one) or creates a new Button component.
A UI Component for the Add button
getMoveUpButtonComponent
public UIComponent getMoveUpButtonComponent(FacesContext context)(Code)
Get or create the MOVE UP button. Retrieves the component specified by the
moveUpButton facet (if there is one) or creates a new Button component.
A UI Component for the moveUp button
Return a string suitable for displaying the value in read only mode.
The default is to separate the list values with a comma.
Parameters: context - The FacesContext throws: javax.faces.FacesException - If the list items cannot be processed