The omnifaces.SelectItemsIndexConverter is a variant of the SelectItemsConverter which
automatically converts based on the position (index) of the selected item in the list instead of the
#toString() of the selected item.
This converter is available by converter ID omnifaces.SelectItemsIndexConverter. Just specify it in the
converter attribute of the selection component holding <f:selectItems>.
<h:selectOneMenu value="#{bean.selectedItem}" converter="omnifaces.SelectItemsIndexConverter">
<f:selectItems value="#{bean.availableItems}" />
</h:selectOneMenu>
Since OmniFaces 4.5 it's also available by <o:selectItemsIndexConverter> tag.
<h:selectOneMenu value="#{bean.selectedItem}">
<f:selectItems value="#{bean.availableItems}" />
<o:selectItemsIndexConverter />
</h:selectOneMenu>
SelectItemsConverter
This converter has the following advantages over SelectItemsConverter:
#toString() method of the object.SelectItemsConverter when #toString() method of the object cannot be
used.#toString(),if that's a problem.
This converter has the following disadvantage over SelectItemsConverter:
| Info | Value |
|---|---|
| Converter ID | omnifaces.SelectItemsIndexConverter |
| Handler Class | None |
| Description | None |
| Name | Required | Type | Description | No Attributes Defined. |
|---|
Output generated by Vdldoc View Declaration Language Documentation Generator.