Use the AddRemove component when the web application user makes selections from a list and they need to see the currently selected items displayed together, and/or they need to reorder the selected items.
author: avk
markSelectedListItems(java.util.List list, boolean processed) Marks options corresponding to objects listed as values of this
component as selected.
Parameters: list - A list representation of the selected values Parameters: processed - If true, compare the values object byobject (this is done if we compare the value of the object withwith the list items).
protected void
processOptions(FacesContext context, Collator collator, Locale locale, boolean rulerAtEnd) Evaluates the list of available Options, creating a ListItem for each
one.
Parameters: context - The FacesContext Parameters: rulerAtEnd - the end of the options.
Field Detail
ADDALL_BUTTON_FACET
final public static String ADDALL_BUTTON_FACET(Code)
Name of the JavaScript function which moves elements up
MULTIPLEADDITIONS_FUNCTION
final public static String MULTIPLEADDITIONS_FUNCTION(Code)
The name of the JavaScript function used to hook up the correct
add and remove functions when the component allows items to be
added to the selected items list more than once
REMOVEALL_BUTTON_FACET
final public static String REMOVEALL_BUTTON_FACET(Code)
The facet name of the "Remove All" button
REMOVEALL_BUTTON_ID
final public static String REMOVEALL_BUTTON_ID(Code)
The component ID for the remove all button
REMOVEALL_FUNCTION
final public static String REMOVEALL_FUNCTION(Code)
Name of the JavaScript function which removes all the items from the seleted list
REMOVE_BUTTON_FACET
final public static String REMOVE_BUTTON_FACET(Code)
public UIComponent getAddAllButtonComponent()(Code)
Get or create the ADD button. Retrieves the component specified by the
addButton facet (if there is one) or creates a new Button component.
A UI Component for the Add button
getAddButtonComponent
public UIComponent getAddButtonComponent(FacesContext context)(Code)
Get or create the ADD button. Retrieves the component specified by the
addButton facet (if there is one) or creates a new Button component.
A UI Component for the Add button Parameters: context - The FacesContext for the request
This function returns a String consisting of the String representation of the
values of all the available Options, separated by the separator
String (see getSeparator())
eturns a String consisting of the String representation of thevalues of all the available Options, separated by the separatorString
getAvailableLabelComponent
public UIComponent getAvailableLabelComponent()(Code)
Gets or creates a component for the "available" list
label. Retrieves the availableLabel facet if one was
specified, or creates a new label component.
A UIComponent for the list label
Gets or creates a component for the "component" list
label. Retrieves the componentLabel facet if one was
specified, or creates a new label component.
A UIComponent for the list label
Retrieve an Iterator of ListSelector.ListItem representing the available selections only.
This method is used by the renderer, to create the options of
the list of available items.
an Iterator over ListItem. Parameters: context - The FacesContext used for the request Parameters: rulerAtEnd - If true, a disabled list item with a blank label is appended at the end of the options. The role of the blank item is to guarantee that the width of the listsdo not change when items are moved from one to the other. throws: javax.faces.FacesException - If something goes wrong when the options are processed
getMoveDownButtonComponent
public UIComponent getMoveDownButtonComponent()(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
getMoveUpButtonComponent
public UIComponent getMoveUpButtonComponent()(Code)
Get or create the MOVEUP 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
public UIComponent getRemoveAllButtonComponent()(Code)
Get or create the REMOVE button. Retrieves the component specified by the
removeButton facet (if there is one) or creates a new Button component.
A UI Component for the Remove button
getRemoveButtonComponent
public UIComponent getRemoveButtonComponent()(Code)
Get or create the REMOVE button. Retrieves the component specified by the
removeButton facet (if there is one) or creates a new Button component.
A UI Component for the Remove button
Returns an iterator over the selected items
an iterator over the selected items
getSelectedLabelComponent
public UIComponent getSelectedLabelComponent()(Code)
Gets or creates a component for the "selected" list
label. Retrieves the selectedLabel facet if one was
specified, or creates a new label component.
A UIComponent for the list label
Retrieve an Iterator of ListSelector.ListItem representing the selected selections only.
This method is used by the renderer, to create the options of
the list of selected items. It is also used when calculating a string
representation of the value of the component.
An Iterator over the selected ListItem
This function returns a String consisting of the String representation of the
values of the selected Options, separated by the separator
String
a String consisting of the String representation of thevalues of the selected Options, separated by the separatorString
Get the separator string that is used to separate the selected values on the client.
The default value is "|". When the AddRemove component is decoded, the
value is taken from a hidden variable whose value is a list of the
values of all the options in the list representing the selected items.
Consider a case where the AddRemove has a list of options including
Assume that these two options are disabled. If the separator
string is set to "|", then the value of the hidden
variable will be |1|2|.
You will only need to set this variable if the string
representation of one of the option values contain the
character "|". If you do need to change from the default,
bear in mind that the value of the hidden component
is sent as part of the body of the HTTP request body.
Make sure to select a character that does not change
the syntax of the request.
The separator string.
Marks options corresponding to objects listed as values of this
component as selected.
Parameters: list - A list representation of the selected values Parameters: processed - If true, compare the values object byobject (this is done if we compare the value of the object withwith the list items). If false, perform a string comparison ofthe string representation of the submitted value of thecomponent with the string representation of the value from thelist items (this is done if we compare the submitted valueswith the list items).
Evaluates the list of available Options, creating a ListItem for each
one.
Parameters: context - The FacesContext Parameters: rulerAtEnd - the end of the options. The role of the blank item is to guarantee that the width of the listsdo not change when items are moved from one to the other.
Methods inherited from com.sun.rave.web.ui.component.AddRemoveBase