java.lang.Object
jakarta.faces.component.UIComponent
jakarta.faces.component.UIComponentBase
jakarta.faces.component.UISelectItems
org.omnifaces.component.model.SelectItemGroups
- All Implemented Interfaces:
PartialStateHolder,StateHolder,TransientStateHolder,ComponentSystemEventListener,FacesListener,SystemEventListenerHolder,EventListener
Deprecated, for removal: This API element is subject to removal in a future version.
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated, for removal: This API element is subject to removal in a future version.The component type, which is "org.omnifaces.component.model.SelectItemGroups".Fields inherited from class jakarta.faces.component.UISelectItems
COMPONENT_FAMILYFields inherited from class jakarta.faces.component.UIComponent
ATTRS_WITH_DECLARED_DEFAULT_VALUES, BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, FACETS_KEY, VIEW_LOCATION_KEY -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated, for removal: This API element is subject to removal in a future version.Returns the label of the select item group.Deprecated, for removal: This API element is subject to removal in a future version.Returns the value of the select item group.getValue()Deprecated, for removal: This API element is subject to removal in a future version.An override which wraps each UISelectItem(s) child in aSelectItemGroup.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.voidsetItemLabel(String itemLabel) Deprecated, for removal: This API element is subject to removal in a future version.Sets the label of the select item group.voidsetItemValue(Object itemValue) Deprecated, for removal: This API element is subject to removal in a future version.Sets the value of the select item group.voidDeprecated, for removal: This API element is subject to removal in a future version.voidsetValueExpression(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 onvarattribute.voidDeprecated, 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.Methods inherited from class jakarta.faces.component.UISelectItems
getFacesContext, getFamilyMethods inherited from class jakarta.faces.component.UIComponentBase
addClientBehavior, addFacesListener, broadcast, clearInitialState, decode, encodeAll, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getPassThroughAttributes, getRenderer, getRendererType, getRendersChildren, invokeOnComponent, isRendered, isTransient, markInitialState, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, restoreState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, visitTreeMethods inherited from class jakarta.faces.component.UIComponent
getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getListenersForEventClass, getNamingContainer, getPassThroughAttributes, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, restoreTransientState, saveTransientState, setInView, subscribeToEvent, unsubscribeFromEvent
-
Field Details
-
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
Deprecated, for removal: This API element is subject to removal in a future version.An override which checks if this isn't been invoked onvarattribute. Finally it delegates to the super method.- Overrides:
setValueExpressionin classUIComponent- Throws:
IllegalArgumentException- When this value expression is been set onvarattribute.
-
getValue
Deprecated, for removal: This API element is subject to removal in a future version.An override which wraps each UISelectItem(s) child in aSelectItemGroup.- Overrides:
getValuein classUISelectItems
-
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 toitem.- Returns:
- The name of the EL variable.
-
setVar
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 toitem.- Parameters:
varName- The name of the EL variable.
-
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 ofitemValue.- Returns:
- The label of the select item group.
-
setItemLabel
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 ofitemValue.- Parameters:
itemLabel- The label of the select item group.
-
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
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
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
setValuein classUISelectItems
-
<f:selectItemGroups>instead, which was introduced in Faces 4.0 and is functionally equivalent.