javax.faces.component
Class UISelectItem

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UISelectItem
All Implemented Interfaces:
StateHolder

public class UISelectItem
extends UIComponentBase

A component representing a single option that the user can choose.

The option attributes can either be defined directly on this component (via the itemValue, itemLabel, itemDescription properties) or the value property can reference a SelectItem object (directly or via an EL expression).

The value expression (if defined) is read-only; the parent select component will have a value attribute specifying where the value for the chosen selection will be stored.

See Javadoc of JSF Specification

Version:
$Revision: 684004 $ $Date: 2008-08-08 10:53:07 -0500 (Fri, 08 Aug 2008) $
Author:
Manfred Geiler (latest modification by $Author: lu4242 $)

Field Summary
static String COMPONENT_FAMILY
           
static String COMPONENT_TYPE
           
 
Constructor Summary
UISelectItem()
           
 
Method Summary
 String getFamily()
           
 String getItemDescription()
          An optional description for this item.
 String getItemLabel()
          Get the string which will be presented to the user for this option.
 Object getItemValue()
          The value of this item, of the same type as the parent component's value.
 Object getValue()
          An EL expression that refers to a javax.faces.model.SelectItem instance.
 boolean isItemDisabled()
          Determine whether this item can be chosen by the user.
 boolean isRendered()
          A boolean value that indicates whether this component should be rendered.
 void restoreState(FacesContext context, Object state)
          Invoked in the "restore view" phase, this initialises this object's members from the values saved previously into the provided state object.
 Object saveState(FacesContext context)
          Invoked after the render phase has completed, this method returns an object which can be passed to the restoreState of some other instance of UIComponentBase to reset that object's state to the same values as this object currently has.
 void setItemDescription(String itemDescription)
           
 void setItemDisabled(boolean itemDisabled)
          When true, this item cannot be chosen by the user.
 void setItemLabel(String itemLabel)
           
 void setItemValue(Object itemValue)
           
 void setRendered(boolean state)
          Disable this property; although this class extends a base-class that defines a read/write rendered property, this particular subclass does not support setting it.
 void setValue(Object value)
           
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, broadcast, decode, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isTransient, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendererType, setTransient, setValueBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMPONENT_TYPE

public static final String COMPONENT_TYPE
See Also:
Constant Field Values

COMPONENT_FAMILY

public static final String COMPONENT_FAMILY
See Also:
Constant Field Values
Constructor Detail

UISelectItem

public UISelectItem()
Method Detail

getFamily

public String getFamily()
Specified by:
getFamily in class UIComponent

setRendered

public void setRendered(boolean state)
Disable this property; although this class extends a base-class that defines a read/write rendered property, this particular subclass does not support setting it. Yes, this is broken OO design: direct all complaints to the JSF spec group.

Overrides:
setRendered in class UIComponentBase

isRendered

public boolean isRendered()
Description copied from class: UIComponentBase
A boolean value that indicates whether this component should be rendered. Default value: true.

Overrides:
isRendered in class UIComponentBase

setItemDescription

public void setItemDescription(String itemDescription)

getItemDescription

public String getItemDescription()
An optional description for this item. For use in development tools.


setItemDisabled

public void setItemDisabled(boolean itemDisabled)
When true, this item cannot be chosen by the user. If this method is ever called, then any EL-binding for the disabled property will be ignored.


isItemDisabled

public boolean isItemDisabled()
Determine whether this item can be chosen by the user.


setItemLabel

public void setItemLabel(String itemLabel)

getItemLabel

public String getItemLabel()
Get the string which will be presented to the user for this option.


setItemValue

public void setItemValue(Object itemValue)

getItemValue

public Object getItemValue()
The value of this item, of the same type as the parent component's value.


setValue

public void setValue(Object value)

getValue

public Object getValue()
An EL expression that refers to a javax.faces.model.SelectItem instance.


saveState

public Object saveState(FacesContext context)
Description copied from class: UIComponentBase
Invoked after the render phase has completed, this method returns an object which can be passed to the restoreState of some other instance of UIComponentBase to reset that object's state to the same values as this object currently has.

Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIComponentBase

restoreState

public void restoreState(FacesContext context,
                         Object state)
Description copied from class: UIComponentBase
Invoked in the "restore view" phase, this initialises this object's members from the values saved previously into the provided state object.

Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIComponentBase
state - is an object previously returned by the saveState method of this class.


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.