com.sun.rave.web.ui.component
Class OrderableListBase

java.lang.Object
  extended byjavax.faces.component.UIComponent
      extended byjavax.faces.component.UIComponentBase
          extended byjavax.faces.component.UIOutput
              extended byjavax.faces.component.UIInput
                  extended bycom.sun.rave.web.ui.component.OrderableListBase
All Implemented Interfaces:
javax.faces.component.EditableValueHolder, javax.faces.component.StateHolder, javax.faces.component.ValueHolder
Direct Known Subclasses:
OrderableList

public abstract class OrderableListBase
extends javax.faces.component.UIInput

Use the ui:orderableList tag to create a list with buttons that allow the items on the list to be reordered.

HTML Elements and Layout

The textField component renders an XHTML fragment consisting of a selectelement representing a list, an input type="hidden" element which represents the current order of the list items, two or four input type="submit" elements for the buttons, and a label element for the label. The buttons are organized using a table, and the whole component is laid out using divs.

Configuring the ui:orderableList Tag

Use the list attribute to associate the component with a set of orderable items. The value of the list attribute must be a JavaServer Faces EL expression that evaluates to an array of Objects or to a java.util.List.

To allow users to select more than one item to move at a time, set multiple to true. To display buttons which moves the selected items to the top and bottom of the list, set moveTopBottom to true.

To specify a label for the component, use the label attribute, or specify a label facet. To place the label above the component, set labelOnTop to true.

Facets

Client-side JavaScript functions

The functions below must be invoked on the JavaScript object that corresponds to the orderableList. The name of this object is OrderableList_id where id is the DOM ID of the OrderableList component (the id of the outermost div with the colons replaced by underscores, e.g. OrderableList_form_taskOrder.

object.updateValue() Use this method to update the hidden field which represents the component value in any JavaScript function that changes the order of the items on the list.
object.moveUp() Moves the selected items up one step and updates the component value.
object.moveDown() Moves the selected items down one step and updates the component value.
object.moveTop() Moves the selected items to the top of the list and updates the component value.
object.moveBottom() Moves the selected items to the bottom of the list and updates the component value.
object.updateButtons() Use this method to update which buttons are selected in any JavaScript method that programmatically selects elements on the list.

Example

Example 1: OrderableList with Move to Top and Move to Bottom Buttons

This example uses a backing bean called AutomatedTasks with a property taskList which represents a list of tasks. Users are allowed to select more than one task to move. Buttons to move the items to the top and to the bottom are shown in addition to the default move up and move down buttons.

     <ui:orderableList id="taskOrder"
                       list="#{AutomatedTasks.taskList}"
                       label="Task execution order: "
                       multiple="true"
                       moveTopBottom="true"/>
 
 

Example 1: OrderableList with Move to Top and Move to Bottom Buttons

This example uses a backing bean called Volunteers and a property rotationOrder which is an ordered list of objects representing individual persons. A converter is used to derive a string representation of the person. Only the default move up and move down buttons are shown.

     <ui:orderableList id="callUpOrder"
                       list="#{Volunteers.rotationOrder}"
                       label="Call Up Order:" >
         <f:converter converterId="org.example.Person"/>
     <ui:orderableList>
 

Auto-generated component class. Do NOT modify; all changes will be lost!


Field Summary
 
Fields inherited from class javax.faces.component.UIInput
COMPONENT_FAMILY, COMPONENT_TYPE, CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID
 
Constructor Summary
OrderableListBase()
          Construct a new OrderableListBase.
 
Method Summary
 java.lang.String getFamily()
          Return the family for this component.
 java.lang.String getLabel()
          If set, a label is rendered adjacent to the component with the value of this attribute as the label text.
 int getLabelLevel()
          Sets the style level for the generated labels.
 java.lang.Object getList()
           The object that represents the list.
 int getRows()
          The number of items to display.
 java.lang.String getStyle()
          CSS style(s) to be applied when this component is rendered.
 java.lang.String getStyleClass()
          CSS style class(es) to be applied when this component is rendered.
 int getTabIndex()
          Position of this element in the tabbing order for the current document.
 java.lang.String getToolTip()
          Display the text as a tooltip for this component
 javax.faces.el.ValueBinding getValueBinding(java.lang.String name)
          Return the ValueBinding stored for the specified name (if any), respecting any property aliases.
 boolean isDisabled()
          Flag indicating that activation of this component by the user is not currently permitted.
 boolean isLabelOnTop()
          If this attribute is true, the label is rendered above the component.
 boolean isMoveTopBottom()
          If this attribute is true, the Move to Top and Move to Bottom buttons are shown.
 boolean isMultiple()
          Flag indicating that the application user may make select more than one option from the listbox .
 boolean isReadOnly()
          If this attribute is set to true, the value of the component is rendered as text, preceded by the label if one was defined.
 boolean isVisible()
          Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page.
 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 setDisabled(boolean disabled)
          Flag indicating that activation of this component by the user is not currently permitted.
 void setLabel(java.lang.String label)
          If set, a label is rendered adjacent to the component with the value of this attribute as the label text.
 void setLabelLevel(int labelLevel)
          Sets the style level for the generated labels.
 void setLabelOnTop(boolean labelOnTop)
          If this attribute is true, the label is rendered above the component.
 void setList(java.lang.Object list)
           The object that represents the list.
 void setMoveTopBottom(boolean moveTopBottom)
          If this attribute is true, the Move to Top and Move to Bottom buttons are shown.
 void setMultiple(boolean multiple)
          Flag indicating that the application user may make select more than one option from the listbox .
 void setReadOnly(boolean readOnly)
          If this attribute is set to true, the value of the component is rendered as text, preceded by the label if one was defined.
 void setRows(int rows)
          The number of items to display.
 void setStyle(java.lang.String style)
          CSS style(s) to be applied when this component is rendered.
 void setStyleClass(java.lang.String styleClass)
          CSS style class(es) to be applied when this component is rendered.
 void setTabIndex(int tabIndex)
          Position of this element in the tabbing order for the current document.
 void setToolTip(java.lang.String toolTip)
          Display the text as a tooltip for this component
 void setValueBinding(java.lang.String name, javax.faces.el.ValueBinding binding)
          Set the ValueBinding stored for the specified name (if any), respecting any property aliases.
 void setVisible(boolean visible)
          Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page.
 
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, broadcast, compareValues, decode, getConvertedValue, getSubmittedValue, getValidator, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, setImmediate, setLocalValueSet, setRequired, setSubmittedValue, setValid, setValidator, setValue, setValueChangeListener, updateModel, validate, validateValue
 
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, getValue, setConverter
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, getValue, setConverter
 

Constructor Detail

OrderableListBase

public OrderableListBase()

Construct a new OrderableListBase.

Method Detail

getFamily

public java.lang.String getFamily()

Return the family for this component.


getValueBinding

public javax.faces.el.ValueBinding getValueBinding(java.lang.String name)

Return the ValueBinding stored for the specified name (if any), respecting any property aliases.

Parameters:
name - Name of value binding to retrieve

setValueBinding

public void setValueBinding(java.lang.String name,
                            javax.faces.el.ValueBinding binding)

Set the ValueBinding stored for the specified name (if any), respecting any property aliases.

Parameters:
name - Name of value binding to set
binding - ValueBinding to set, or null to remove

isDisabled

public boolean isDisabled()

Flag indicating that activation of this component by the user is not currently permitted.


setDisabled

public void setDisabled(boolean disabled)

Flag indicating that activation of this component by the user is not currently permitted.

See Also:
isDisabled()

getLabel

public java.lang.String getLabel()

If set, a label is rendered adjacent to the component with the value of this attribute as the label text.


setLabel

public void setLabel(java.lang.String label)

If set, a label is rendered adjacent to the component with the value of this attribute as the label text.

See Also:
getLabel()

getLabelLevel

public int getLabelLevel()

Sets the style level for the generated labels. Valid values are 1 (largest), 2 and 3 (smallest). The default value is 2.


setLabelLevel

public void setLabelLevel(int labelLevel)

Sets the style level for the generated labels. Valid values are 1 (largest), 2 and 3 (smallest). The default value is 2.

See Also:
getLabelLevel()

isLabelOnTop

public boolean isLabelOnTop()

If this attribute is true, the label is rendered above the component. If it is false, the label is rendered next to the component. The default is false.


setLabelOnTop

public void setLabelOnTop(boolean labelOnTop)

If this attribute is true, the label is rendered above the component. If it is false, the label is rendered next to the component. The default is false.

See Also:
isLabelOnTop()

getList

public java.lang.Object getList()

The object that represents the list. It must be a JavaServer Faces EL expression that evaluates to an array of Objects or to a java.util.List.


setList

public void setList(java.lang.Object list)

The object that represents the list. It must be a JavaServer Faces EL expression that evaluates to an array of Objects or to a java.util.List.

See Also:
getList()

isMoveTopBottom

public boolean isMoveTopBottom()

If this attribute is true, the Move to Top and Move to Bottom buttons are shown. The default is false.


setMoveTopBottom

public void setMoveTopBottom(boolean moveTopBottom)

If this attribute is true, the Move to Top and Move to Bottom buttons are shown. The default is false.

See Also:
isMoveTopBottom()

isMultiple

public boolean isMultiple()

Flag indicating that the application user may make select more than one option from the listbox .


setMultiple

public void setMultiple(boolean multiple)

Flag indicating that the application user may make select more than one option from the listbox .

See Also:
isMultiple()

isReadOnly

public boolean isReadOnly()

If this attribute is set to true, the value of the component is rendered as text, preceded by the label if one was defined.


setReadOnly

public void setReadOnly(boolean readOnly)

If this attribute is set to true, the value of the component is rendered as text, preceded by the label if one was defined.

See Also:
isReadOnly()

getRows

public int getRows()

The number of items to display. The default value is 6.


setRows

public void setRows(int rows)

The number of items to display. The default value is 6.

See Also:
getRows()

getStyle

public java.lang.String getStyle()

CSS style(s) to be applied when this component is rendered.


setStyle

public void setStyle(java.lang.String style)

CSS style(s) to be applied when this component is rendered.

See Also:
getStyle()

getStyleClass

public java.lang.String getStyleClass()

CSS style class(es) to be applied when this component is rendered.


setStyleClass

public void setStyleClass(java.lang.String styleClass)

CSS style class(es) to be applied when this component is rendered.

See Also:
getStyleClass()

getTabIndex

public int getTabIndex()

Position of this element in the tabbing order for the current document. The tabbing order determines the sequence in which elements receive focus when the tab key is pressed. The tabIndex value must be an integer between 0 and 32767.


setTabIndex

public void setTabIndex(int tabIndex)

Position of this element in the tabbing order for the current document. The tabbing order determines the sequence in which elements receive focus when the tab key is pressed. The tabIndex value must be an integer between 0 and 32767.

See Also:
getTabIndex()

getToolTip

public java.lang.String getToolTip()

Display the text as a tooltip for this component


setToolTip

public void setToolTip(java.lang.String toolTip)

Display the text as a tooltip for this component

See Also:
getToolTip()

isVisible

public boolean isVisible()

Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page. If set to false, the HTML code for the component is present in the page, but the component is hidden with style attributes. By default, visible is set to true, so HTML for the component HTML is included and visible to the user. If the component is not visible, it can still be processed on subsequent form submissions because the HTML is present.


setVisible

public void setVisible(boolean visible)

Use the visible attribute to indicate whether the component should be viewable by the user in the rendered HTML page. If set to false, the HTML code for the component is present in the page, but the component is hidden with style attributes. By default, visible is set to true, so HTML for the component HTML is included and visible to the user. If the component is not visible, it can still be processed on subsequent form submissions because the HTML is present.

See Also:
isVisible()

restoreState

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

Restore the state of this component.


saveState

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

Save the state of this component.