You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Michael Heinen <mh...@googlemail.com> on 2012/04/02 11:56:51 UTC
use collections with selectManyCheckboxes and JSF 2.1?
Hi all,
I have another weird problem during the migration from JSF 1.2 to 2.1.
In my model I use ArrayLists for the value of selectManyCheckboxes.
If a form is now posted StringArrays are received instead of ArrayLists!
After a lot of debugging I stumbled over two new attributes:
collectionType and valueType.
I set collectionType to "java.util.ArrayList" and valueType to
"java.lang.String".
To my surprise this did not help.
Tag usage:
<t:aliasBean
<t:dataList
<t:selectManyCheckbox id="cboxCPsel"
rendered="#{cpLink.typeSelectManyCheckBox ||
cpLink.typeTree}"
disabled="#{aliasCodingPanelReadonly ||
cpLink.readOnly}"
value="#{MyProxyController.myDocument.attributes[cpLink.name]}"
var="sItem"
collectionType="java.util.ArrayList"
valueType="java.lang.String">
<f:selectItems value="#{MyProxyController.categories[cpLink.name]}"/>
</t:selectManyCheckbox>
Further debugging:
org.apache.myfaces.shared_tomahawk.renderkit._SharedRendererUtils.getConvertedUISelectManyValue
line 133:
Class<?> modelType = expression .getType(facesContext.getELContext());
modelType is now java.lang.Object!
What's going wrong here?
How can I use Collections with selectManyCheckboxes and JSF 2.1?
libs:
tomahawk20-1.1.11.jar
myfaces 2.1.6
richfaces 4.2 Final
Regards,
Michael
Re: use collections with selectManyCheckboxes and JSF 2.1?
Posted by Michael Heinen <mh...@googlemail.com>.
Issue created:
https://issues.apache.org/jira/browse/MYFACES-3522
Am 03.04.2012 09:09, schrieb Werner Punz:
> Ok this seems like a bug to me, can you file a bugreport on
>
> https://issues.apache.org/jira/browse/MYFACES
>
> So that it will be fixed until the next release.
> Leonardo our core maintainer is pretty quick in fixing bugs.
>
> Werner
>
>
> Am 02.04.12 15:45, schrieb Michael Heinen:
>> I use a List of SelectItems for the inner f:selectItems tag.
>> The value attribute of selectManyCheckbox points to an ArrayList with
>> Strings, representing the selected values.
>> The checkboxes are initially correctly checked, but after ajax
>> submission my model (Map<Sting,Object) contains StringArrays instead of
>> ArrayLists.
>>
>> Indeed this worked well since JSF 1.0, but it does not work with 2.1
>> anymore in my case.
>> BTW: I use Tomcat 6.0.35 (and selectManyCheckboxes work well with
>> myfaces 1.2.10 and richfaces 3.3.3)
>>
>> Michael
>>
>>
>>
>>
>>
>> Am 02.04.2012 15:30, schrieb Werner Punz:
>>> Am 02.04.12 11:56, schrieb Michael Heinen:
>>>
>>>> What's going wrong here?
>>>> How can I use Collections with selectManyCheckboxes and JSF 2.1?
>>>>
>>>>
>>> Hi I usually pass a list of SelectItem Objects that has been working
>>> since JSF 1.0.
>>>
>>> Werner
>>>
>>>
>>>
>>
>>
>
>
>
Re: use collections with selectManyCheckboxes and JSF 2.1?
Posted by Werner Punz <we...@gmail.com>.
Ok this seems like a bug to me, can you file a bugreport on
https://issues.apache.org/jira/browse/MYFACES
So that it will be fixed until the next release.
Leonardo our core maintainer is pretty quick in fixing bugs.
Werner
Am 02.04.12 15:45, schrieb Michael Heinen:
> I use a List of SelectItems for the inner f:selectItems tag.
> The value attribute of selectManyCheckbox points to an ArrayList with
> Strings, representing the selected values.
> The checkboxes are initially correctly checked, but after ajax
> submission my model (Map<Sting,Object) contains StringArrays instead of
> ArrayLists.
>
> Indeed this worked well since JSF 1.0, but it does not work with 2.1
> anymore in my case.
> BTW: I use Tomcat 6.0.35 (and selectManyCheckboxes work well with
> myfaces 1.2.10 and richfaces 3.3.3)
>
> Michael
>
>
>
>
>
> Am 02.04.2012 15:30, schrieb Werner Punz:
>> Am 02.04.12 11:56, schrieb Michael Heinen:
>>
>>> What's going wrong here?
>>> How can I use Collections with selectManyCheckboxes and JSF 2.1?
>>>
>>>
>> Hi I usually pass a list of SelectItem Objects that has been working
>> since JSF 1.0.
>>
>> Werner
>>
>>
>>
>
>
Re: use collections with selectManyCheckboxes and JSF 2.1?
Posted by Michael Heinen <mh...@googlemail.com>.
I use a List of SelectItems for the inner f:selectItems tag.
The value attribute of selectManyCheckbox points to an ArrayList with
Strings, representing the selected values.
The checkboxes are initially correctly checked, but after ajax
submission my model (Map<Sting,Object) contains StringArrays instead of
ArrayLists.
Indeed this worked well since JSF 1.0, but it does not work with 2.1
anymore in my case.
BTW: I use Tomcat 6.0.35 (and selectManyCheckboxes work well with
myfaces 1.2.10 and richfaces 3.3.3)
Michael
Am 02.04.2012 15:30, schrieb Werner Punz:
> Am 02.04.12 11:56, schrieb Michael Heinen:
>
>> What's going wrong here?
>> How can I use Collections with selectManyCheckboxes and JSF 2.1?
>>
>>
> Hi I usually pass a list of SelectItem Objects that has been working
> since JSF 1.0.
>
> Werner
>
>
>
Re: use collections with selectManyCheckboxes and JSF 2.1?
Posted by Werner Punz <we...@gmail.com>.
Am 02.04.12 11:56, schrieb Michael Heinen:
> What's going wrong here?
> How can I use Collections with selectManyCheckboxes and JSF 2.1?
>
>
Hi I usually pass a list of SelectItem Objects that has been working
since JSF 1.0.
Werner