Class SelectItemGroups

All Implemented Interfaces:
PartialStateHolder, StateHolder, TransientStateHolder, ComponentSystemEventListener, FacesListener, SystemEventListenerHolder, EventListener

@Deprecated(since="5.4", forRemoval=true) public class SelectItemGroups extends UISelectItems
Deprecated, for removal: This API element is subject to removal in a future version.
Since OmniFaces 5.4. Use the standard <f:selectItemGroups> instead, which was introduced in Faces 4.0 and is functionally equivalent.

The o:selectItemGroups is an extension of UISelectItems which allows you to iterate over a nested collection representing groups of select items. This is basically the UIComponent counterpart of jakarta.faces.model.SelectItemGroup.

Usage

Below example assumes a List<Category> as value wherein Category in turn has a List<Product>.

 <h:selectOneMenu value="#{bean.selectedProduct}" converter="omnifaces.SelectItemsConverter">
     <f:selectItem itemValue="#{null}" />
     <o:selectItemGroups value="#{bean.categories}" var="category" itemLabel="#{category.name}">
         <f:selectItems value="#{category.products}" var="product" itemLabel="#{product.name}" />
     </o:selectItemGroups>
 </h:selectOneMenu>
 
Since:
3.0
Author:
Bauke Scholtz
  • Field Details

    • COMPONENT_TYPE

      public static final String COMPONENT_TYPE
      Deprecated, for removal: This API element is subject to removal in a future version.
      The component type, which is "org.omnifaces.component.model.SelectItemGroups".
      See Also:
  • Constructor Details

    • SelectItemGroups

      public SelectItemGroups()
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • setValueExpression

      public void setValueExpression(String name, ValueExpression binding)
      Deprecated, for removal: This API element is subject to removal in a future version.
      An override which checks if this isn't been invoked on var attribute. Finally it delegates to the super method.
      Overrides:
      setValueExpression in class UIComponent
      Throws:
      IllegalArgumentException - When this value expression is been set on var attribute.
    • getValue

      public Object getValue()
      Deprecated, for removal: This API element is subject to removal in a future version.
      An override which wraps each UISelectItem(s) child in a SelectItemGroup.
      Overrides:
      getValue in class UISelectItems
    • getVar

      public String getVar()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the name of the EL variable which exposes the currently iterated select item group. Defaults to item.
      Returns:
      The name of the EL variable.
    • setVar

      public void setVar(String varName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the name of the EL variable which exposes the currently iterated select item group. Defaults to item.
      Parameters:
      varName - The name of the EL variable.
    • getItemLabel

      public String getItemLabel()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the label of the select item group. Defaults to the String representation of itemValue.
      Returns:
      The label of the select item group.
    • setItemLabel

      public void setItemLabel(String itemLabel)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the label of the select item group. Defaults to the String representation of itemValue.
      Parameters:
      itemLabel - The label of the select item group.
    • getItemValue

      public Object getItemValue()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the value of the select item group. This will be exposed to any nested UISelectItem(s) children. Defaults to the currently iterated select item group.
      Returns:
      The value of the select item group.
    • setItemValue

      public void setItemValue(Object itemValue)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the value of the select item group. This will be exposed to any nested UISelectItem(s) children. Defaults to the currently iterated select item group.
      Parameters:
      itemValue - The value of the select item group.
    • setValue

      public void setValue(Object value)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      setValue in class UISelectItems