myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leonardo Uribe <lu4...@gmail.com>
Subject Re: t:selectManyPicklist does not assign POST data to bean property if nested in h:dataTable or ui:repeat
Date Thu, 12 Apr 2012 15:54:43 GMT
Hi

I have checked the component and it is ok.

The problem described happens because ValueExpression.getValueType()
returns Object.class when an structure like:

private List<List<Test>> multipleValues = new LinkedList<List<Test>>();

is used. You could try setting valueType attribute to java.util.List
in this way:

       <t:selectManyPicklist value="#{l}"
converter="#{util.createEntityConverter(manager.availableValues)}"
valueType="java.util.List">

I think that should work.

regards,

Leonardo Uribe

2012/4/12 Max Goltzsche <max.goltzsche@googlemail.com>:
> Hello again,
>
> Replacing myfaces 2.1.2 api and impl with corresponding myfaces 2.1.7 jars
> in Tomee 1.0.0 beta 2 does also not solve the problem.
> Please help!
>
> regards,
> Max
>
> 2012/4/11 Max Goltzsche <max.goltzsche@googlemail.com>
>
>> Hello dear myfaces users,
>>
>> I've already described my problem in my last mail but I forgot to tell you
>> the environment I am working with:
>>     tomee 1.0 beta 2 with myfaces 2.1.2 + tomahawk 1.1.11 for JSF2
>>
>> In my example the first t:selectManyPicklist works fine but not the second
>> nested in a ui:repeat or a h:dataTable tag. Why?
>> I think the fact the first one works well proves my configuration's
>> accuracy. My web.xml declares faces servlet + myfaces extensions filter
>> usage. My faces-config.xml contains the empty faces-config tag.
>> Please help!
>>
>> regards,
>> Max
>>
>>
>> 2012/4/4 Max Goltzsche <max.goltzsche@googlemail.com>
>>
>>> Hello,
>>>
>>> I think there is a bug in tomahawk's selectManyPicklist component:
>>> Although the POST values have been sent they are not assigned to the
>>> corresponding bean's property if the picklist component is nested in a
>>> h:dataTable or ui:repeat component (tested with both components but may
>>> also affect usage with other loop components). I've prepared a simple
>>> example:
>>>
>>> Facelet code:
>>> <h:form>
>>>     <t:selectManyPicklist value="#{manager.values}"
>>>
>>> converter="#{util.createEntityConverter(manager.availableValues)}">
>>>         <f:selectItems
>>> value="#{util.createSelectItems(manager.availableValues)}" />
>>>     </t:selectManyPicklist>
>>>
>>>     <ui:repeat var="l" value="#{manager.multipleValues}">
>>>         <h:message for="list"/>
>>>         <t:selectManyPicklist value="#{l}"
>>>
>>> converter="#{util.createEntityConverter(manager.availableValues)}">
>>>             <f:selectItems
>>> value="#{util.createSelectItems(manager.availableValues)}" />
>>>         </t:selectManyPicklist>
>>>     </ui:repeat>
>>>
>>>     <h:commandButton value="save" action="#{manager.save()}" />
>>> </h:form>
>>>
>>> Manager.java (ManagedBean):
>>> public class Manager {
>>>     private List<Test> availableValues = new LinkedList<Test>();
>>>     private List<Test> values = new LinkedList<Test>();
>>>     private List<List<Test>> multipleValues = new
>>> LinkedList<List<Test>>();
>>>
>>>     // ... getter'n'setter, empty save() method ...
>>> }
>>>
>>> Test is an example entity with an id property.
>>> The util.createEntityConverter method returns a converter to convert Test
>>> entities by their id.
>>> The util.createSelectItems method simply returns a list of SelectItem
>>> instances for each given entity.
>>>
>>> The example's first selectManyPicklist works well. The second is
>>> correctly displayed and its values are sent with the POST request when
>>> clicking the "save" button but not assigned to the serverside bean's
>>> property.
>>>
>>> Maybe there is a mistake in my usage of that component. Can someone
>>> verify that, please?
>>> What am I doing wrong or is it a bug?
>>>
>>> regards,
>>> Max
>>>
>>
>>

Mime
View raw message