|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.faces.component.UIComponent javax.faces.component.UIComponentBase javax.faces.component.UIOutput javax.faces.component.UIInput com.sun.rave.web.ui.component.OrderableListBase
Use the ui:orderableList
tag to create a list with
buttons that allow the items on the list to be reordered.
The textField component renders an XHTML fragment consisting of a
select
element 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 div
s.
ui:orderableList
TagUse 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.
label
: use this facet to specify a custom
component for the label.readOnly
: use this facet to specify a custom
component for displaying the value of this component when it is
marked as readonly. The default is a
ui:staticText
. moveUpButton
: use this facet to specify a custom
component for the button that moves items up one step.moveDownButton
: use this facet to specify a custom
component for the button that moves items down one step.moveTopButton
: use this facet to specify a custom
component for the button that moves items to the top.moveBottomButton
: use this facet to specify a custom
component for the button that moves items to the bottom.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. |
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"/>
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 |
public OrderableListBase()
Construct a new OrderableListBase
.
Method Detail |
public java.lang.String getFamily()
Return the family for this component.
public javax.faces.el.ValueBinding getValueBinding(java.lang.String name)
Return the ValueBinding
stored for the
specified name (if any), respecting any property aliases.
name
- Name of value binding to retrievepublic 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.
name
- Name of value binding to setbinding
- ValueBinding to set, or null to removepublic boolean isDisabled()
Flag indicating that activation of this component by the user is not currently permitted.
public void setDisabled(boolean disabled)
Flag indicating that activation of this component by the user is not currently permitted.
isDisabled()
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.
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.
getLabel()
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.
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.
getLabelLevel()
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.
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.
isLabelOnTop()
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
.
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
.
getList()
public boolean isMoveTopBottom()
If this attribute is true, the Move to Top and Move to Bottom buttons are shown. The default is false.
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.
isMoveTopBottom()
public boolean isMultiple()
Flag indicating that the application user may make select more than one option from the listbox .
public void setMultiple(boolean multiple)
Flag indicating that the application user may make select more than one option from the listbox .
isMultiple()
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.
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.
isReadOnly()
public int getRows()
The number of items to display. The default value is 6.
public void setRows(int rows)
The number of items to display. The default value is 6.
getRows()
public java.lang.String getStyle()
CSS style(s) to be applied when this component is rendered.
public void setStyle(java.lang.String style)
CSS style(s) to be applied when this component is rendered.
getStyle()
public java.lang.String getStyleClass()
CSS style class(es) to be applied when this component is rendered.
public void setStyleClass(java.lang.String styleClass)
CSS style class(es) to be applied when this component is rendered.
getStyleClass()
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.
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.
getTabIndex()
public java.lang.String getToolTip()
Display the text as a tooltip for this component
public void setToolTip(java.lang.String toolTip)
Display the text as a tooltip for this component
getToolTip()
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.
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.
isVisible()
public void restoreState(javax.faces.context.FacesContext _context, java.lang.Object _state)
Restore the state of this component.
public java.lang.Object saveState(javax.faces.context.FacesContext _context)
Save the state of this component.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |