The omnifaces.ListIndexConverter is a variant of the ListConverter 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.ListIndexConverter and should be used in combination with <o:converter>
in order to be able to pass the List source to it, which it can use for conversion. Here's a basic usage example with PrimeFaces
<p:pickList>, which is one of the few select components which doesn't use SelectItems as the source, but work directly via a
List.
<p:pickList value="#{bean.dualListModel}" var="entity" itemValue="#{entity}" itemLabel="#{entity.someProperty}">
<o:converter converterId="omnifaces.ListIndexConverter" list="#{bean.dualListModel.source}" />
</p:pickList>
Since OmniFaces 4.5 it's also available by <o:listIndexConverter> tag.
<p:pickList value="#{bean.dualListModel}" var="entity" itemValue="#{entity}" itemLabel="#{entity.someProperty}">
<o:listIndexConverter" list="#{bean.dualListModel.source}" />
</p:pickList>
ListConverter
For detail, refer the javadoc of SelectItemsIndexConverter and substitute "SelectItemsIndexConverter" by
"ListIndexConverter" and "SelectItemsConverter" by "ListConverter".
| Info | Value |
|---|---|
| Converter ID | omnifaces.ListIndexConverter |
| Handler Class | None |
| Description | None |
| Name | Required | Type | Description |
|---|---|---|---|
list | true | jakarta.el.ValueExpression
(must evaluate to java.util.List)
| The list of available items. |
Output generated by Vdldoc View Declaration Language Documentation Generator.