This content has been marked as final.
Show 3 replies
-
1. Re: [JBSEAM-1302]: Conversion support for selectMany for Set
fhh May 18, 2007 6:04 AM (in response to fhh)I took a closer look at the jsf implementation. The relvant bit of code is this (from com.sun.faces.renderkit.html_basic.MenuRenderer.convertSelectManyValue()):
modelType = valueExpression.getType(context.getELContext()); // Does the valueExpression resolve properly to something with // a type? if (null != modelType) { if (modelType.isArray()) { result = convertSelectManyValues(context, uiSelectMany, modelType, newValues); } else if (List.class.isAssignableFrom(modelType)) { result = Arrays.asList((Object[]) convertSelectManyValues( context, uiSelectMany, Object[].class, newValues)); } else { throwException = true; }
So, this seems to be a limitation of JSF indeed.
What surprises me is that it would be trivival to fix. Sets must have been left out on purpose. Does anybody know why? The way the html component work, support for sets seems more natural then lists.
Regards
Felix -
2. Re: [JBSEAM-1302]: Conversion support for selectMany for Set
fhh May 18, 2007 8:43 AM (in response to fhh)Replying to myself again:
MyFaces does a similar thing:if (List.class.isAssignableFrom(valueType)) { // do something } if (!valueType.isArray()) { throw new IllegalArgumentException("ValueBinding for UISelectMany : "+getPathToComponent(component)+" must be of type List or Array"); }
So, please close Bug 1302 as unfixable.
Regards
Felix
P.S.: Will update JIRA with a link to the is thread. -
3. Re: [JBSEAM-1302]: Conversion support for selectMany for Set
pmuir Jun 10, 2007 6:31 PM (in response to fhh)"fhh" wrote:
What surprises me is that it would be trivival to fix. Sets must have been left out on purpose. Does anybody know why?
Adam Winer blogged about this regarding UIData - IIRC its mainly an oversight, but there are also performance problems. I'm pretty sure we can get this sorted in JSF 2.0 - I have a utility class here http://jroller.com/page/pmuir?entry=using_sets_in_jsf for backing DataModels, it should work fine for selections as well, but I haven't checked ;) If it does I'll add it to seam-ui