eclipse-ee4j / mojarra

Mojarra, a Jakarta Faces implementation
Other
158 stars 107 forks source link

UISelectMany collectionType ignored when VE resolves to non-Collection #5427

Closed BalusC closed 3 months ago

BalusC commented 3 months ago

https://stackoverflow.com/q/78214508

This,

private Map<String, List<Entity>> entitiesByKey;
<h:selectManyCheckbox value="#{bean.entitiesByKey[key]}" collectionType="java.util.ArrayList">

isn't working because VE resolves to java.lang.Object instead of to an instance of java.util.Collection.

When VE resolves to java.lang.Object while collectionType is explicitly mentioned, it should be used to create the Collection instance rather than defaulting to an Object[]. Currently, the collectionType is unexpectedly ignored when VE resolves to java.lang.Object.