[ 
https://issues.apache.org/jira/browse/MYFACES-2418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12782676#action_12782676
 ] 

Jakob Korherr commented on MYFACES-2418:
----------------------------------------

I tested these two scenarios an mojarra and I already have a solution for the 
first problem.

The second problem is a bit strange. If you use something like this

public List<Integer> getSomeFieldValue()
{
.....
} 

on mojarra and you also have SelectItems containing Integers, mojarra renders 
the SelectItems, while MyFaces already fails here, because it cannot get a 
Converter to convert the Integers to Strings for rendering. This is, of course, 
easy to solve (we just have to take a look at the value type of the 
SelectItems).

However, if you submit your selections on mojarra it adds the submitted values, 
which are of type String, without any conversion to the ArrayList, which will 
be set in setSomeFieldValue(List<Integer> value). This works, because java does 
not check the type at runtime.
But now we have the problem that when we want to access the values, we will get 
Strings instead of the expected Integers, which may cause «strange looking» 
ClassCastExceptions in the user code.

Should we behave exactly like mojarra at this point, which on my opinion is 
stupid and may confuse a lot of developers, or should we try to obtain a 
Converter some other way?
I think looking at the type of the SelectItems will provide us a valid 
converter and would be a better way.

The spec, of course, does not mention anything about this.

> Implement h:selectManyXXX collectionType and hideNoSelectionOption
> ------------------------------------------------------------------
>
>                 Key: MYFACES-2418
>                 URL: https://issues.apache.org/jira/browse/MYFACES-2418
>             Project: MyFaces Core
>          Issue Type: Task
>          Components: JSR-314
>            Reporter: Leonardo Uribe
>         Attachments: myfaces-2418.patch
>
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to