Class UISelectItem

All Implemented Interfaces:
PartialStateHolder, StateHolder, TransientStateHolder, ComponentSystemEventListener, FacesListener, SystemEventListenerHolder, EventListener
Direct Known Subclasses:
RadioRenderer.GroupSelectItem, UISelectItemGroup

public class UISelectItem extends UIComponentBase

UISelectItem is a component that may be nested inside a UISelectMany or UISelectOne component, and causes the addition of a SelectItem instance to the list of available options for the parent component. The contents of the SelectItem can be specified in one of the following ways:

  • The value attribute's value is an instance of SelectItem.
  • The associated ValueExpression points at a model data item of type SelectItem.
  • A new SelectItem instance is synthesized from the values of the itemDescription, itemDisabled, itemLabel, itemEscaped, and itemValue attributes.
  • Field Details

    • COMPONENT_TYPE

      public static final String COMPONENT_TYPE

      The standard component type for this component.

      See Also:
    • COMPONENT_FAMILY

      public static final String COMPONENT_FAMILY

      The standard component family for this component.

      See Also:
  • Constructor Details

    • UISelectItem

      public UISelectItem()

      Create a new UISelectItem instance with default property values.

  • Method Details

    • getFamily

      public String getFamily()
      Description copied from class: UIComponent

      Return the identifier of the component family to which this component belongs. This identifier, in conjunction with the value of the rendererType property, may be used to select the appropriate Renderer for this component instance. Note this method should NOT return null

      Specified by:
      getFamily in class UIComponent
      Returns:
      the component family (not null).
    • getItemDescription

      public String getItemDescription()

      Return the description for this selection item.

      Returns:
      the item description.
    • setItemDescription

      public void setItemDescription(String itemDescription)

      Set the description for this selection item.

      Parameters:
      itemDescription - The new description
    • isItemDisabled

      public boolean isItemDisabled()

      Return the disabled setting for this selection item.

      Returns:
      true is the item disabled, false otherwise.
    • setItemDisabled

      public void setItemDisabled(boolean itemDisabled)

      Set the disabled value for this selection item.

      Parameters:
      itemDisabled - The new disabled flag
    • isItemEscaped

      public boolean isItemEscaped()

      Return the escape setting for the label of this selection item.

      Returns:
      true if the item is escaped, false otherwise.
    • setItemEscaped

      public void setItemEscaped(boolean itemEscaped)

      Set the escape value for the label of this selection item.

      Parameters:
      itemEscaped - The new disabled flag
    • getItemLabel

      public String getItemLabel()

      Return the localized label for this selection item.

      Returns:
      the item label.
    • setItemLabel

      public void setItemLabel(String itemLabel)

      Set the localized label for this selection item.

      Parameters:
      itemLabel - The new localized label
    • getItemValue

      public Object getItemValue()

      Return the server value for this selection item.

      Returns:
      the item value.
    • setItemValue

      public void setItemValue(Object itemValue)

      Set the server value for this selection item.

      Parameters:
      itemValue - The new server value
    • getValue

      public Object getValue()

      Returns the value property of the UISelectItem.

      Returns:
      the value.
    • setValue

      public void setValue(Object value)

      Sets the value property of the UISelectItem.

      Parameters:
      value - the new value
    • isNoSelectionOption

      public boolean isNoSelectionOption()

      Return the value of the noSelectionOption property. If the value of this property is true, the system interprets the option represented by this UISelectItem instance as representing a "no selection" option. See UISelectOne.validateValue(jakarta.faces.context.FacesContext, java.lang.Object) and UISelectMany.validateValue(jakarta.faces.context.FacesContext, java.lang.Object) for usage.

      Returns:
      the no selection option.
      Since:
      2.0
    • setNoSelectionOption

      public void setNoSelectionOption(boolean noSelectionOption)

      Set the value of the noSelectionOption property.

      Parameters:
      noSelectionOption - the no selection option.
      Since:
      2.0