com.sun.webui.jsf.component
Class AddRemove

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIOutput
              extended by javax.faces.component.UIInput
                  extended by com.sun.webui.jsf.component.WebuiInput
                      extended by com.sun.webui.jsf.component.Selector
                          extended by com.sun.webui.jsf.component.ListSelector
                              extended by com.sun.webui.jsf.component.AddRemove
All Implemented Interfaces:
com.sun.webui.jsf.component.ComplexComponent, com.sun.webui.jsf.component.ListManager, com.sun.webui.jsf.component.SelectorManager, javax.faces.component.EditableValueHolder, javax.faces.component.NamingContainer, javax.faces.component.StateHolder, javax.faces.component.ValueHolder

public class AddRemove
extends ListSelector
implements com.sun.webui.jsf.component.ListManager

The AddRemove component is used to construct a list of selected items.

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.


Field Summary
static java.lang.String ADD_BUTTON_FACET
          The facet name of the add button
static java.lang.String ADD_BUTTON_ID
          The component id for the ADD button
static java.lang.String ADD_FUNCTION
          Name of the JavaScript function which is responsible for adding elements from the availble list to the selected list
static java.lang.String ADD_TEXT_KEY
          Add button text key.
static java.lang.String ADDALL_BUTTON_FACET
          The facet name of the Add All button
static java.lang.String ADDALL_BUTTON_ID
          The component id for the ADD ALL button
static java.lang.String ADDALL_FUNCTION
          Name of the JavaScript function which is responsible for selecting all the available items
static java.lang.String ADDALL_TEXT_KEY
          Add all button text key.
static java.lang.String ADDALLVERTICAL_TEXT_KEY
          Add all button text key, vertical layout.
static java.lang.String ADDREMOVE_LABEL_LEVEL
          The label level key.
static java.lang.String ADDREMOVE_ROWS
          The rows.
static java.lang.String ADDVERTICAL_TEXT_KEY
          Add button text key, vertical layout.
static java.lang.String AVAILABLE_ID
          The id of the label component that functions as the label above the available list
static java.lang.String AVAILABLE_LABEL_FACET
          The facet name of the label over the "Available" list
static java.lang.String AVAILABLE_LABEL_ID
          The component ID for the items list
static java.lang.String AVAILABLE_ONCHANGE_FUNCTION
          Name of the JavaScript function that handles changes on the available list
static java.lang.String AVAILABLE_TEXT_KEY
          The available label text key.
static java.lang.String FOOTER_FACET
          Facet name for the footer facet
static java.lang.String HEADER_FACET
          Facet name for the header facet
static java.lang.String HEADER_ID
          The facet name of the header (component label)
static java.lang.String MOVEDOWN_BUTTON_FACET
          The facet name of the "Move Down" button
static java.lang.String MOVEDOWN_BUTTON_ID
          The component ID for the move down button
static java.lang.String MOVEDOWN_FUNCTION
          Name of the JavaScript function which moves elements down
static java.lang.String MOVEDOWN_TEXT_KEY
          Move down button text key.
static java.lang.String MOVEUP_BUTTON_FACET
          The facet name of the "Move Up" button
static java.lang.String MOVEUP_BUTTON_ID
          The component ID for the move up button
static java.lang.String MOVEUP_FUNCTION
          Name of the JavaScript function which moves elements up
static java.lang.String MOVEUP_TEXT_KEY
          Move up button text key.
static java.lang.String MULTIPLEADDITIONS_FUNCTION
          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
static java.lang.String READ_ONLY_LABEL_FACET
          The facet name of the label readonly case
static java.lang.String READONLY_ID
          The ID of the component readonly case
static java.lang.String REMOVE_BUTTON_FACET
          The facet name of the remove button
static java.lang.String REMOVE_BUTTON_ID
          The component ID for the remove button
static java.lang.String REMOVE_FUNCTION
          Name of the JavaScript function which removes items from the seleted list
static java.lang.String REMOVE_TEXT_KEY
          Remove button text key.
static java.lang.String REMOVEALL_BUTTON_FACET
          The facet name of the "Remove All" button
static java.lang.String REMOVEALL_BUTTON_ID
          The component ID for the remove all button
static java.lang.String REMOVEALL_FUNCTION
          Name of the JavaScript function which removes all the items from the seleted list
static java.lang.String REMOVEALL_TEXT_KEY
          Remove all button text key.
static java.lang.String REMOVEALLVERTICAL_TEXT_KEY
          Remove all button text key, vertical layout.
static java.lang.String REMOVEVERTICAL_TEXT_KEY
          Remove button text key, vertical layout
static java.lang.String RETURN
          String representing "return false" printed at the end of the javascript event handlers
static java.lang.String SELECTED_ID
          The ID of the component that functions as the label above the "Selected" list
static java.lang.String SELECTED_LABEL_FACET
          The facet name of the label over the "Selected" list
static java.lang.String SELECTED_LABEL_ID
          The component ID for the selected list
static java.lang.String SELECTED_ONCHANGE_FUNCTION
          Name of the JavaScript function which handles changes to the selected list
static java.lang.String SELECTED_TEXT_KEY
          The selected label text key.
static java.lang.String SEPARATOR_VALUE
          The string used as a separator between the selected values
static java.lang.String SPACER_STRING
           
static java.lang.String UPDATEBUTTONS_FUNCTION
          Name of the JavaScript function that updates the buttons
 
Fields inherited from class com.sun.webui.jsf.component.ListSelector
LABEL_FACET, LIST_ID, VALUE_ID, VALUE_LABEL_ID
 
Fields inherited from class javax.faces.component.UIInput
COMPONENT_FAMILY, COMPONENT_TYPE, CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
AddRemove()
          Constructor for the AddRemove component
 
Method Summary
 javax.faces.component.UIComponent getAddAllButtonComponent()
          Return a component that implements the add all button.
 javax.faces.component.UIComponent getAddButtonComponent()
          Return a component that implements the add button.
 javax.faces.component.UIComponent getAddButtonComponent(javax.faces.context.FacesContext context)
          Deprecated. See getAddButtonComponent();
 java.lang.String getAllValues()
          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())
 java.lang.String getAvailableItemsLabel()
          The label for the list of available items.
 javax.faces.component.UIComponent getAvailableLabelComponent()
          Return a component that implements a label for the available list.
 java.lang.String getFamily()
          Return the family for this component.
 java.lang.String getFocusElementId(javax.faces.context.FacesContext context)
          Returns the id of an HTML element suitable to receive the focus.
 javax.faces.component.UIComponent getHeaderComponent()
          Return a component that implements a label for the AddRemove component.
 java.lang.String getLabeledElementId(javax.faces.context.FacesContext context)
          Returns the absolute ID of an HTML element suitable for use as the value of an HTML LABEL element's for attribute.
 int getLabelLevel()
           
 java.util.Iterator getListItems(javax.faces.context.FacesContext context, boolean rulerAtEnd)
          Retrieve an Iterator of ListSelector.ListItem representing the available selections only.
 javax.faces.component.UIComponent getMoveDownButtonComponent()
          Return a component that implements the move down button.
 javax.faces.component.UIComponent getMoveUpButtonComponent()
          Return a component that implements the move up button.
 java.lang.String getOnBlur()
          Scripting code executed when this element loses focus.
 java.lang.String getOnChange()
          Scripting code executed when the element value of this component is changed.
 java.lang.String getOnClick()
          Scripting code executed when a mouse click occurs over this component.
 java.lang.String getOnDblClick()
          Scripting code executed when a mouse double click occurs over this component.
 java.lang.String getOnFocus()
          Scripting code executed when this component receives focus.
 java.lang.String getOnKeyDown()
          Scripting code executed when the user presses down on a key while the component has focus.
 java.lang.String getOnKeyPress()
          Scripting code executed when the user presses and releases a key while the component has focus.
 java.lang.String getOnKeyUp()
          Scripting code executed when the user releases a key while the component has focus.
 java.lang.String getOnMouseDown()
          Scripting code executed when the user presses a mouse button while the mouse pointer is on the component.
 java.lang.String getOnMouseMove()
          Scripting code executed when the user moves the mouse pointer while over the component.
 java.lang.String getOnMouseOut()
          Scripting code executed when a mouse out movement occurs over this component.
 java.lang.String getOnMouseOver()
          Scripting code executed when the user moves the mouse pointer into the boundary of this component.
 java.lang.String getOnMouseUp()
          Scripting code executed when the user releases a mouse button while the mouse pointer is on the component.
 java.lang.String getOnSelect()
          Scripting code executed when some text in this component value is selected.
 java.lang.String getPrimaryElementID(javax.faces.context.FacesContext context)
          Deprecated.  
 javax.faces.component.UIComponent getReadOnlyLabelComponent()
          Return a component that implements a label for the readOnly selected list.
 javax.faces.component.UIComponent getRemoveAllButtonComponent()
          Return a component that implements the remove all button.
 javax.faces.component.UIComponent getRemoveButtonComponent()
          Return a component that implements the remove button.
 int getRows()
          Return the number of items to display in the available and selected lists.
 java.util.Iterator getSelectedItems()
          Returns an iterator over the selected items This function will return one separator element com.sun.web.ui.separator in addition to the selected items even if the selected list is empty.
 java.lang.String getSelectedItemsLabel()
          The label for the list of selected items.
 javax.faces.component.UIComponent getSelectedLabelComponent()
          Return a component that implements a label for the selected list.
 java.util.Iterator getSelectedListItems()
          Retrieve an Iterator of ListSelector.ListItem representing the selected selections only.
 java.lang.String getSelectedValues()
          This function returns a String consisting of the String representation of the values of the selected Options, separated by the separator String
 java.lang.String getSeparator()
          Get the separator string that is used to separate the selected values on the client.
 java.lang.Object getValue()
           
 java.lang.String getWidth()
          Return a value suitable for the CSS width property to be applied to an HTML select element.
 boolean isDuplicateSelections()
          If true, items in the available list are not removed when they are added to the selected list.
 boolean isMoveButtons()
          Shows the Move Up and Move Down buttons.
 boolean isSelectAll()
          Show the Add All and Remove All buttons.
 boolean isSeparators()
          Flag indicating that items corresponding to com.sun.webui.jsf.model.Option that are defined inside a com.sun.webui.jsf.model.OptionGroup should be surrounded by separators inside the list.
 boolean isSorted()
          If true, the items on the available list are shown in alphabetical order.
 boolean isVertical()
          Uses the vertical layout instead of the default horizontal layout.
 boolean mainListSubmits()
           
 void restoreState(javax.faces.context.FacesContext _context, java.lang.Object _state)
          Restore the state of this component.
 java.lang.Object saveState(javax.faces.context.FacesContext _context)
          Save the state of this component.
 void setAvailableItemsLabel(java.lang.String availableItemsLabel)
          The label for the list of available items.
 void setDuplicateSelections(boolean duplicateSelections)
          If true, items in the available list are not removed when they are added to the selected list.
 void setMoveButtons(boolean moveButtons)
          Shows the Move Up and Move Down buttons.
 void setSelectAll(boolean selectAll)
          Show the Add All and Remove All buttons.
 void setSelectedItemsLabel(java.lang.String selectedItemsLabel)
          The label for the list of selected items.
 void setSorted(boolean sorted)
          If true, the items on the available list are shown in alphabetical order.
 void setVertical(boolean vertical)
          Uses the vertical layout instead of the default horizontal layout.
 
Methods inherited from class com.sun.webui.jsf.component.ListSelector
checkSelectionModel, getIndicatorComponent, getLabelComponent, getListItems, getReadOnlyValueComponent, getSeparatorLength, getValueAsReadOnly, getValueAsStringArray, isLabelOnTop, isVisible, setLabelOnTop, setRows, setSeparators, setVisible, setWidth
 
Methods inherited from class com.sun.webui.jsf.component.Selector
getConvertedValue, getItems, getLabel, getRendersChildren, getSelected, getStyle, getStyleClass, getTabIndex, getToolTip, getValueExpression, isDisabled, isMultiple, isReadOnly, setDisabled, setItems, setLabel, setLabelLevel, setMultiple, setOnBlur, setOnChange, setOnClick, setOnDblClick, setOnFocus, setOnKeyDown, setOnKeyPress, setOnKeyUp, setOnMouseDown, setOnMouseMove, setOnMouseOut, setOnMouseOver, setOnMouseUp, setOnSelect, setReadOnly, setSelected, setStyle, setStyleClass, setTabIndex, setToolTip, setValueExpression, toString
 
Methods inherited from class com.sun.webui.jsf.component.WebuiInput
broadcast, getValidator, getValidatorExpression, getValueChangeListener, getValueChangeListenerExpression, processDecodes, processUpdates, processValidators, setConverter, setId, setImmediate, setRendered, setRequired, setValidatorExpression, setValueChangeListenerExpression
 
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, decode, getConverterMessage, getRequiredMessage, getSubmittedValue, getValidatorMessage, getValidators, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, removeValidator, removeValueChangeListener, resetValue, setConverterMessage, setLocalValueSet, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, updateModel, validate
 
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue
 
Methods inherited from class javax.faces.component.UIComponentBase
encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRendererType, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, restoreAttachedState, saveAttachedState, setParent, setRendererType, setTransient, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.sun.webui.jsf.component.ListManager
getReadOnlyValueComponent, getToolTip, getValueAsStringArray, isVisible
 
Methods inherited from interface javax.faces.component.EditableValueHolder
addValidator, addValueChangeListener, getSubmittedValue, getValidator, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, removeValidator, removeValueChangeListener, setImmediate, setLocalValueSet, setRequired, setSubmittedValue, setValid, setValidator, setValueChangeListener
 
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, setConverter, setValue
 
Methods inherited from interface com.sun.webui.jsf.component.SelectorManager
getClientId, getStyle, getStyleClass, getTabIndex, isDisabled, isMultiple, isReadOnly
 
Methods inherited from interface com.sun.webui.jsf.component.ComplexComponent
getIndicatorComponent
 

Field Detail

ADD_BUTTON_ID

public static final java.lang.String ADD_BUTTON_ID
The component id for the ADD button

See Also:
Constant Field Values

ADD_BUTTON_FACET

public static final java.lang.String ADD_BUTTON_FACET
The facet name of the add button

See Also:
Constant Field Values

ADDALL_BUTTON_ID

public static final java.lang.String ADDALL_BUTTON_ID
The component id for the ADD ALL button

See Also:
Constant Field Values

ADDALL_BUTTON_FACET

public static final java.lang.String ADDALL_BUTTON_FACET
The facet name of the Add All button

See Also:
Constant Field Values

REMOVE_BUTTON_ID

public static final java.lang.String REMOVE_BUTTON_ID
The component ID for the remove button

See Also:
Constant Field Values

REMOVE_BUTTON_FACET

public static final java.lang.String REMOVE_BUTTON_FACET
The facet name of the remove button

See Also:
Constant Field Values

REMOVEALL_BUTTON_ID

public static final java.lang.String REMOVEALL_BUTTON_ID
The component ID for the remove all button

See Also:
Constant Field Values

REMOVEALL_BUTTON_FACET

public static final java.lang.String REMOVEALL_BUTTON_FACET
The facet name of the "Remove All" button

See Also:
Constant Field Values

MOVEUP_BUTTON_ID

public static final java.lang.String MOVEUP_BUTTON_ID
The component ID for the move up button

See Also:
Constant Field Values

MOVEUP_BUTTON_FACET

public static final java.lang.String MOVEUP_BUTTON_FACET
The facet name of the "Move Up" button

See Also:
Constant Field Values

MOVEDOWN_BUTTON_ID

public static final java.lang.String MOVEDOWN_BUTTON_ID
The component ID for the move down button

See Also:
Constant Field Values

MOVEDOWN_BUTTON_FACET

public static final java.lang.String MOVEDOWN_BUTTON_FACET
The facet name of the "Move Down" button

See Also:
Constant Field Values

AVAILABLE_LABEL_ID

public static final java.lang.String AVAILABLE_LABEL_ID
The component ID for the items list

See Also:
Constant Field Values

AVAILABLE_LABEL_FACET

public static final java.lang.String AVAILABLE_LABEL_FACET
The facet name of the label over the "Available" list

See Also:
Constant Field Values

READ_ONLY_LABEL_FACET

public static final java.lang.String READ_ONLY_LABEL_FACET
The facet name of the label readonly case

See Also:
Constant Field Values

SELECTED_LABEL_ID

public static final java.lang.String SELECTED_LABEL_ID
The component ID for the selected list

See Also:
Constant Field Values

SELECTED_LABEL_FACET

public static final java.lang.String SELECTED_LABEL_FACET
The facet name of the label over the "Selected" list

See Also:
Constant Field Values

HEADER_FACET

public static final java.lang.String HEADER_FACET
Facet name for the header facet

See Also:
Constant Field Values

HEADER_ID

public static final java.lang.String HEADER_ID
The facet name of the header (component label)

See Also:
Constant Field Values

FOOTER_FACET

public static final java.lang.String FOOTER_FACET
Facet name for the footer facet

See Also:
Constant Field Values

AVAILABLE_ID

public static final java.lang.String AVAILABLE_ID
The id of the label component that functions as the label above the available list

See Also:
Constant Field Values

AVAILABLE_TEXT_KEY

public static final java.lang.String AVAILABLE_TEXT_KEY
The available label text key.

See Also:
Constant Field Values

SELECTED_ID

public static final java.lang.String SELECTED_ID
The ID of the component that functions as the label above the "Selected" list

See Also:
Constant Field Values

SELECTED_TEXT_KEY

public static final java.lang.String SELECTED_TEXT_KEY
The selected label text key.

See Also:
Constant Field Values

READONLY_ID

public static final java.lang.String READONLY_ID
The ID of the component readonly case

See Also:
Constant Field Values

RETURN

public static final java.lang.String RETURN
String representing "return false" printed at the end of the javascript event handlers

See Also:
Constant Field Values

ADD_FUNCTION

public static final java.lang.String ADD_FUNCTION
Name of the JavaScript function which is responsible for adding elements from the availble list to the selected list

See Also:
Constant Field Values

ADD_TEXT_KEY

public static final java.lang.String ADD_TEXT_KEY
Add button text key.

See Also:
Constant Field Values

ADDVERTICAL_TEXT_KEY

public static final java.lang.String ADDVERTICAL_TEXT_KEY
Add button text key, vertical layout.

See Also:
Constant Field Values

ADDALL_FUNCTION

public static final java.lang.String ADDALL_FUNCTION
Name of the JavaScript function which is responsible for selecting all the available items

See Also:
Constant Field Values

ADDALL_TEXT_KEY

public static final java.lang.String ADDALL_TEXT_KEY
Add all button text key.

See Also:
Constant Field Values

ADDALLVERTICAL_TEXT_KEY

public static final java.lang.String ADDALLVERTICAL_TEXT_KEY
Add all button text key, vertical layout.

See Also:
Constant Field Values

REMOVE_FUNCTION

public static final java.lang.String REMOVE_FUNCTION
Name of the JavaScript function which removes items from the seleted list

See Also:
Constant Field Values

REMOVE_TEXT_KEY

public static final java.lang.String REMOVE_TEXT_KEY
Remove button text key.

See Also:
Constant Field Values

REMOVEVERTICAL_TEXT_KEY

public static final java.lang.String REMOVEVERTICAL_TEXT_KEY
Remove button text key, vertical layout

See Also:
Constant Field Values

REMOVEALL_FUNCTION

public static final java.lang.String REMOVEALL_FUNCTION
Name of the JavaScript function which removes all the items from the seleted list

See Also:
Constant Field Values

REMOVEALL_TEXT_KEY

public static final java.lang.String REMOVEALL_TEXT_KEY
Remove all button text key.

See Also:
Constant Field Values

REMOVEALLVERTICAL_TEXT_KEY

public static final java.lang.String REMOVEALLVERTICAL_TEXT_KEY
Remove all button text key, vertical layout.

See Also:
Constant Field Values

MOVEUP_FUNCTION

public static final java.lang.String MOVEUP_FUNCTION
Name of the JavaScript function which moves elements up

See Also:
Constant Field Values

MOVEUP_TEXT_KEY

public static final java.lang.String MOVEUP_TEXT_KEY
Move up button text key.

See Also:
Constant Field Values

MOVEDOWN_FUNCTION

public static final java.lang.String MOVEDOWN_FUNCTION
Name of the JavaScript function which moves elements down

See Also:
Constant Field Values

MOVEDOWN_TEXT_KEY

public static final java.lang.String MOVEDOWN_TEXT_KEY
Move down button text key.

See Also:
Constant Field Values

UPDATEBUTTONS_FUNCTION

public static final java.lang.String UPDATEBUTTONS_FUNCTION
Name of the JavaScript function that updates the buttons

See Also:
Constant Field Values

AVAILABLE_ONCHANGE_FUNCTION

public static final java.lang.String AVAILABLE_ONCHANGE_FUNCTION
Name of the JavaScript function that handles changes on the available list

See Also:
Constant Field Values

SELECTED_ONCHANGE_FUNCTION

public static final java.lang.String SELECTED_ONCHANGE_FUNCTION
Name of the JavaScript function which handles changes to the selected list

See Also:
Constant Field Values

MULTIPLEADDITIONS_FUNCTION

public static final java.lang.String MULTIPLEADDITIONS_FUNCTION
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

See Also:
Constant Field Values

SPACER_STRING

public static final java.lang.String SPACER_STRING
See Also:
Constant Field Values

SEPARATOR_VALUE

public static final java.lang.String SEPARATOR_VALUE
The string used as a separator between the selected values

See Also:
Constant Field Values

ADDREMOVE_LABEL_LEVEL

public static final java.lang.String ADDREMOVE_LABEL_LEVEL
The label level key. It is used to overwrite the Label component's default value.

See Also:
Constant Field Values

ADDREMOVE_ROWS

public static final java.lang.String ADDREMOVE_ROWS
The rows. It is used to determine the default number of rows for the available and selected lists.

See Also:
Constant Field Values
Constructor Detail

AddRemove

public AddRemove()
Constructor for the AddRemove component

Method Detail

getFamily

public java.lang.String getFamily()

Return the family for this component.

Overrides:
getFamily in class ListSelector

getRows

public int getRows()
Return the number of items to display in the available and selected lists. If no value has been set or is less than 1 or there is no value binding or the value binding evaluates to null, then the value of the addRemove.size theme key defined in the messages theme category, is returned. If the theme key is not defined, 12 is returned.

Specified by:
getRows in interface com.sun.webui.jsf.component.ListManager
Overrides:
getRows in class ListSelector
Returns:
The number of items to disaplay

getSeparator

public java.lang.String getSeparator()
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.

Returns:
The separator string.

getSelectedItems

public java.util.Iterator getSelectedItems()
Returns an iterator over the selected items This function will return one separator element com.sun.web.ui.separator in addition to the selected items even if the selected list is empty.

Returns:
an iterator over the selected items

getAllValues

public java.lang.String getAllValues()
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())

Returns:
eturns a String consisting of the String representation of the values of all the available Options, separated by the separator String

getSelectedValues

public java.lang.String getSelectedValues()
This function returns a String consisting of the String representation of the values of the selected Options, separated by the separator String

Returns:
a String consisting of the String representation of the values of the selected Options, separated by the separator String

getAddButtonComponent

public javax.faces.component.UIComponent getAddButtonComponent(javax.faces.context.FacesContext context)
Deprecated. See getAddButtonComponent();

Get or create the ADD button. Retrieves the component specified by the addButton facet (if there is one) or creates a new Button component.

Parameters:
context - The FacesContext for the request
Returns:
A UI Component for the Add button

getAddButtonComponent

public javax.faces.component.UIComponent getAddButtonComponent()
Return a component that implements the add button. If a facet named addButton is found that component is returned. Otherwise a Button component is returned. It is assigned the id
getId() + "_addButton"

If the facet is not defined then the returned Button component is re-intialized every time this method is called.

Returns:
an add button component

getAddAllButtonComponent

public javax.faces.component.UIComponent getAddAllButtonComponent()
Return a component that implements the add all button. If a facet named addAllButton is found that component is returned. Otherwise a Button component is returned. It is assigned the id
getId() + "_addAllButton"

If the facet is not defined then the returned Button component is re-intialized every time this method is called.

Returns:
an add all button component

getRemoveButtonComponent

public javax.faces.component.UIComponent getRemoveButtonComponent()
Return a component that implements the remove button. If a facet named removeButton is found that component is returned. Otherwise a Button component is returned. It is assigned the id
getId() + "_removeButton"

If the facet is not defined then the returned Button component is re-intialized every time this method is called.

Returns:
a remove button component

getRemoveAllButtonComponent

public javax.faces.component.UIComponent getRemoveAllButtonComponent()
Return a component that implements the remove all button. If a facet named removeAllButton is found that component is returned. Otherwise a Button component is returned. It is assigned the id
getId() + "_removeAllButton"

If the facet is not defined then the returned Button component is re-intialized every time this method is called.

Returns:
a remove all button component

getMoveUpButtonComponent

public javax.faces.component.UIComponent getMoveUpButtonComponent()
Return a component that implements the move up button. If a facet named moveUpButton is found that component is returned. Otherwise a Button component is returned. It is assigned the id
getId() + "_moveUpButton"

If the facet is not defined then the returned Button component is re-intialized every time this method is called.

Returns:
a move up button component

getMoveDownButtonComponent

public javax.faces.component.UIComponent getMoveDownButtonComponent()
Return a component that implements the move down button. If a facet named moveDownButton is found that component is returned. Otherwise a Button component is returned. It is assigned the id
getId() + "_moveDownButton"

If the facet is not defined then the returned Button component is re-intialized every time this method is called.

Returns:
a move down button component

getAvailableLabelComponent

public javax.faces.component.UIComponent getAvailableLabelComponent()
Return a component that implements a label for the available list. If a facet named availableLabel is found that component is returned. Otherwise a Label component is returned. It is assigned the id
getId() + "_availableLabel"

If the facet is not defined then the returned Label component is re-intialized every time this method is called.

Returns:
an available list label facet component

getSelectedLabelComponent

public javax.faces.component.UIComponent getSelectedLabelComponent()
Return a component that implements a label for the selected list. If a facet named selectedLabel is found that component is returned. Otherwise a Label component is returned. It is assigned the id
getId() + "_selectedLabel"

If the facet is not defined then the returned Label component is re-intialized every time this method is called.

Returns:
a selected list label facet component

getReadOnlyLabelComponent

public javax.faces.component.UIComponent getReadOnlyLabelComponent()
Return a component that implements a label for the readOnly selected list. If a facet named selectedLabel is found that component is returned. Otherwise a Label component is returned. It is assigned the id
getId() + "_selectedLabel"

If the facet is not defined then the returned Label component is re-intialized every time this method is called.

Returns:
a selected list label facet component

getHeaderComponent

public javax.faces.component.UIComponent getHeaderComponent()
Return a component that implements a label for the AddRemove component. If a facet named header is found that component is returned. Otherwise a Label component is returned. It is assigned the id
getId() + "_header"

If the facet is not defined then the returned Label component is re-intialized every time this method is called.

Returns:
a header list label facet component

getPrimaryElementID

public java.lang.String getPrimaryElementID(javax.faces.context.FacesContext context)
Deprecated. 

Implement this method so that it returns the DOM ID of the HTML element which should receive focus when the component receives focus, and to which a component label should apply. Usually, this is the first element that accepts input.

Specified by:
getPrimaryElementID in interface com.sun.webui.jsf.component.ComplexComponent
Overrides:
getPrimaryElementID in class ListSelector
Parameters:
context - The FacesContext for the request
Returns:
The client id, also the JavaScript element id
See Also:
getLabeledElementId(javax.faces.context.FacesContext), getFocusElementId(javax.faces.context.FacesContext)

getLabeledElementId

public java.lang.String getLabeledElementId(javax.faces.context.FacesContext context)
Returns the absolute ID of an HTML element suitable for use as the value of an HTML LABEL element's for attribute. If the ComplexComponent has sub-compoents, and one of the sub-components is the target of a label, if that sub-component is a ComplexComponent, then getLabeledElementId must called on the sub-component and the value returned. The value returned by this method call may or may not resolve to a component instance.

If isReadOnly returns true, then the getReadOnlyValueComponent method is called. If the component instance returned is a ComplexComponent then getLabeledElementId is called on it and the value returned, else its client id is returned.

Specified by:
getLabeledElementId in interface com.sun.webui.jsf.component.ComplexComponent
Overrides:
getLabeledElementId in class ListSelector
Parameters:
context - The FacesContext used for the request
Returns:
An abolute id suitable for the value of an HTML LABEL element's for attribute.

getFocusElementId

public java.lang.String getFocusElementId(javax.faces.context.FacesContext context)
Returns the id of an HTML element suitable to receive the focus. If the ComplexComponent has sub-compoents, and one of the sub-components is to reveive the focus, if that sub-component is a ComplexComponent, then getFocusElementId must called on the sub-component and the value returned. The value returned by this method call may or may not resolve to a component instance.

This implementation returns the value of getLabeledElementId.

Specified by:
getFocusElementId in interface com.sun.webui.jsf.component.ComplexComponent
Overrides:
getFocusElementId in class ListSelector
Parameters:
context - The FacesContext used for the request

getListItems

public java.util.Iterator getListItems(javax.faces.context.FacesContext context,
                                       boolean rulerAtEnd)
                                throws javax.faces.FacesException
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.

Specified by:
getListItems in interface com.sun.webui.jsf.component.ListManager
Overrides:
getListItems in class ListSelector
Parameters:
context - The FacesContext used for the request
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 lists do not change when items are moved from one to the other.
Returns:
an Iterator over ListItem.
Throws:
javax.faces.FacesException - If something goes wrong when the options are processed

getSelectedListItems

public java.util.Iterator getSelectedListItems()
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.

Returns:
An Iterator over the selected ListItem

mainListSubmits

public boolean mainListSubmits()
Specified by:
mainListSubmits in interface com.sun.webui.jsf.component.ListManager
Overrides:
mainListSubmits in class ListSelector

getValue

public java.lang.Object getValue()
Specified by:
getValue in interface javax.faces.component.ValueHolder
Overrides:
getValue in class javax.faces.component.UIOutput

getLabelLevel

public int getLabelLevel()
Overrides:
getLabelLevel in class Selector

isSeparators

public boolean isSeparators()
Description copied from class: ListSelector

Flag indicating that items corresponding to com.sun.webui.jsf.model.Option that are defined inside a com.sun.webui.jsf.model.OptionGroup should be surrounded by separators inside the list. The default value is true. If false, no separators are shown. To manually specify the location of separators, set this flag to false and place instances of com.sun.webui.jsf.model.Separator between the relevant com.sun.webui.jsf.model.Option instances when specifying the items attribute.

Overrides:
isSeparators in class ListSelector

getOnBlur

public java.lang.String getOnBlur()
Description copied from class: Selector

Scripting code executed when this element loses focus.

Overrides:
getOnBlur in class Selector

getOnChange

public java.lang.String getOnChange()
Description copied from class: Selector

Scripting code executed when the element value of this component is changed.

Specified by:
getOnChange in interface com.sun.webui.jsf.component.SelectorManager
Overrides:
getOnChange in class Selector

getOnClick

public java.lang.String getOnClick()
Description copied from class: Selector

Scripting code executed when a mouse click occurs over this component.

Overrides:
getOnClick in class Selector

getOnDblClick

public java.lang.String getOnDblClick()
Description copied from class: Selector

Scripting code executed when a mouse double click occurs over this component.

Overrides:
getOnDblClick in class Selector

getOnFocus

public java.lang.String getOnFocus()
Description copied from class: Selector

Scripting code executed when this component receives focus. An element receives focus when the user selects the element by pressing the tab key or clicking the mouse.

Overrides:
getOnFocus in class Selector

getOnKeyDown

public java.lang.String getOnKeyDown()
Description copied from class: Selector

Scripting code executed when the user presses down on a key while the component has focus.

Overrides:
getOnKeyDown in class Selector

getOnKeyPress

public java.lang.String getOnKeyPress()
Description copied from class: Selector

Scripting code executed when the user presses and releases a key while the component has focus.

Overrides:
getOnKeyPress in class Selector

getOnKeyUp

public java.lang.String getOnKeyUp()
Description copied from class: Selector

Scripting code executed when the user releases a key while the component has focus.

Overrides:
getOnKeyUp in class Selector

getOnMouseDown

public java.lang.String getOnMouseDown()
Description copied from class: Selector

Scripting code executed when the user presses a mouse button while the mouse pointer is on the component.

Overrides:
getOnMouseDown in class Selector

getOnMouseMove

public java.lang.String getOnMouseMove()
Description copied from class: Selector

Scripting code executed when the user moves the mouse pointer while over the component.

Overrides:
getOnMouseMove in class Selector

getOnMouseOut

public java.lang.String getOnMouseOut()
Description copied from class: Selector

Scripting code executed when a mouse out movement occurs over this component.

Overrides:
getOnMouseOut in class Selector

getOnMouseOver

public java.lang.String getOnMouseOver()
Description copied from class: Selector

Scripting code executed when the user moves the mouse pointer into the boundary of this component.

Overrides:
getOnMouseOver in class Selector

getOnMouseUp

public java.lang.String getOnMouseUp()
Description copied from class: Selector

Scripting code executed when the user releases a mouse button while the mouse pointer is on the component.

Overrides:
getOnMouseUp in class Selector

getOnSelect

public java.lang.String getOnSelect()
Description copied from class: Selector

Scripting code executed when some text in this component value is selected.

Overrides:
getOnSelect in class Selector

getAvailableItemsLabel

public java.lang.String getAvailableItemsLabel()

The label for the list of available items.


setAvailableItemsLabel

public void setAvailableItemsLabel(java.lang.String availableItemsLabel)

The label for the list of available items.

See Also:
getAvailableItemsLabel()

isDuplicateSelections

public boolean isDuplicateSelections()

If true, items in the available list are not removed when they are added to the selected list. The user is permitted to add an available item more than once to the list of selected items. The list of selected items would then contain duplicate entries.


setDuplicateSelections

public void setDuplicateSelections(boolean duplicateSelections)

If true, items in the available list are not removed when they are added to the selected list. The user is permitted to add an available item more than once to the list of selected items. The list of selected items would then contain duplicate entries.

See Also:
isDuplicateSelections()

isMoveButtons

public boolean isMoveButtons()

Shows the Move Up and Move Down buttons.


setMoveButtons

public void setMoveButtons(boolean moveButtons)

Shows the Move Up and Move Down buttons.

See Also:
isMoveButtons()

isSelectAll

public boolean isSelectAll()

Show the Add All and Remove All buttons.


setSelectAll

public void setSelectAll(boolean selectAll)

Show the Add All and Remove All buttons.

See Also:
isSelectAll()

getSelectedItemsLabel

public java.lang.String getSelectedItemsLabel()

The label for the list of selected items.


setSelectedItemsLabel

public void setSelectedItemsLabel(java.lang.String selectedItemsLabel)

The label for the list of selected items.

See Also:
getSelectedItemsLabel()

isSorted

public boolean isSorted()

If true, the items on the available list are shown in alphabetical order. The items on the selected options list are also shown in alphabetical order, unless the moveButtons attribute is true, in which case the user is expected to order the elements.


setSorted

public void setSorted(boolean sorted)

If true, the items on the available list are shown in alphabetical order. The items on the selected options list are also shown in alphabetical order, unless the moveButtons attribute is true, in which case the user is expected to order the elements.

See Also:
isSorted()

isVertical

public boolean isVertical()

Uses the vertical layout instead of the default horizontal layout. The vertical layout displays the available items list above the selected items list.


setVertical

public void setVertical(boolean vertical)

Uses the vertical layout instead of the default horizontal layout. The vertical layout displays the available items list above the selected items list.

See Also:
isVertical()

getWidth

public java.lang.String getWidth()
Description copied from class: ListSelector
Return a value suitable for the CSS width property to be applied to an HTML select element.

This ListSelector base class interprets a null value to imply that the select element should size itself based on the length of the longest option.

Specified by:
getWidth in interface com.sun.webui.jsf.component.ListManager
Overrides:
getWidth in class ListSelector
Returns:
The value used to determine the width of a select HTML element.

restoreState

public void restoreState(javax.faces.context.FacesContext _context,
                         java.lang.Object _state)

Restore the state of this component.

Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class ListSelector

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext _context)

Save the state of this component.

Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class ListSelector


Copyright © 2008 Sun Microsystems, Inc. All Rights Reserved.