Summary
Tag name: <t:selectItems>
UIComponent class: org.apache.myfaces.custom.selectitems.UISelectItems
Tag class: org.apache.myfaces.custom.selectitems.SelectItemsTag
Component type: org.apache.myfaces.UISelectItems
Component family: javax.faces.SelectItems
An extended version of the standard UISelectItems. Populates the
SelectItem collection from the given value automatically using
the itemLabel and itemValue attributes. By using the component
there is no need to manually create a SelectItem collection
because component automatically populates SelectItem objects
from types like Collection, Map and etc..
Usage
<h:selectOneMenu id="menu1" value="#{selectItemsBean.selectedCarColor}"> <t:selectItems value="#{selectItemsBean.carList}" var="Car" itemLabel="#{Car.type}" itemValue="#{Car.color}" /> </h:selectOneMenu>
Attributes
Name | Type | Supports EL? | Description |
---|---|---|---|
binding | String | Only EL | Identifies a backing bean property (of type UIComponent or appropriate subclass) to bind to this component instance. This value must be an EL expression. |
id | String | Yes | An identifier for this particular component instance within
a component view.
The id must be unique within the scope of the tag's enclosing NamingContainer (eg h:form or f:subview). The id is not necessarily unique across all components in the current view This value must be a static value, ie not change over the lifetime of a component. It cannot be defined via an EL expression; only a string is permitted. |
itemLabel | Object | Yes | name of the selectitem |
itemValue | Object | Yes | value of the selectitem |
useEntryAsItem | boolean | Yes | Only applies when value points to a map. Use the Entry instance instead the value for resolve EL Expressions |
value | Object | Yes | An EL expression that specifies the contents of the selection list.
The expression can refer to one of the following:
|
var | String | Yes | name of the iterator |