Just found the following in the Java EE Documentation for javax.faces.component.UISelectMany
:
Obtain the Converter using the following algorithm: If the component has an attached Converter, use it. If not, look for a ValueExpression for value (if any). The ValueExpression must point to something that is:
- An array of primitives (such as int[]). Look up the registered
by-class Converter for this primitive type.- An array of objects (such as Integer[] or String[]). Look up the
registered by-class Converter for the underlying element type.- A java.util.Collection. Do not convert the values.
For a better understanding, I would like to know why the values won't be converted if the ValueExpression is a Collection.
If I want to attach a converter to UISelectMany, do I need to write a converter for the Collection or for the underlying element type?