I gather that you're using <o:importConstants>
for the <f:selectItems value>
? The GenericEnumConverter
isn't taking care of this. It plays only a role on converting between the select item value and the component's value. It doesn't play any role on displaying the item labels.
The <o:importConstants>
basically makes the enum values available in EL scope as a Map<String, Enum>
. Although the <f:selectItems>
can take a Map<K, V>
, it however doesn't support iterating over a Map<K, V>
by var
. You need to convert it to a Map.Entry[]
first:
<f:selectItems value="#{ErrorType.entrySet().toArray()}" var="er"
itemValue="#{er.value}" itemLabel="#{er.value.number}"/>