jsr372-experts@javaserverfaces-spec-public.java.net

[jsr372-experts] Re: StateHelper inside Repeat

From: arjan tijms <arjan.tijms_at_gmail.com>
Date: Wed, 25 Feb 2015 10:41:52 +0100

Hi,

On Wednesday, February 25, 2015, Hanspeter <hampidu_at_gmail.com> wrote:

> So there might be iteraring components that do no proper children state
> handling per iterarion - these need to be fixed.
>
I don't have a direct answer to Cagatay's question, but I do like to remark
it would be beneficial if we'd had a proper base class for iterating
components. Currently UIRepeat, UIData and what else is out there have to
implement the same features and get the same fixes all the time.

Kind regards,
Arjan



> Best regards
> Hanspeter
> Am 24.02.2015 15:20 schrieb "Cagatay Civici" <cagatay.civici_at_gmail.com
> <javascript:_e(%7B%7D,'cvml','cagatay.civici_at_gmail.com');>>:
>
>> That would be great.
>>
>> Cagatay Civici
>> PrimeFaces Lead
>> PrimeTek Informatics
>> www.primefaces.org
>>
>> On Tuesday 24 February 2015 at 16:12, Kito Mann wrote:
>>
>> I wonder if a simple helper method that uses the clientId internally
>> might help:
>>
>> getStateHelper().putIterableValue("mystate", somevalue);
>>
>> Not a good name, but you get the idea.
>>
>> ___
>>
>> Kito D. Mann | @kito99 | Author, JSF in Action
>> Virtua, Inc. | http://www.virtua.com | JSF/Java EE training and
>> consulting
>> http://www.JSFCentral.com | @jsfcentral
>> +1 203-998-0403
>>
>> * Listen to the Enterprise Java Newscast: *http://
>> <http://blogs.jsfcentral.com/JSFNewscast/>enterprisejavanews.com
>> <http://ww.enterprisejavanews.com>*
>> * JSFCentral Interviews Podcast:
>> http://www.jsfcentral.com/resources/jsfcentralpodcasts/
>> * Sign up for the JSFCentral Newsletter:
>> http://oi.vresp.com/?fid=ac048d0e17
>>
>> On Tue, Feb 24, 2015 at 9:05 AM, Cagatay Civici <cagatay.civici_at_gmail.com
>> <javascript:_e(%7B%7D,'cvml','cagatay.civici_at_gmail.com');>> wrote:
>>
>> Hi,
>>
>> When a component uses state map via stateHelper a problem occurs in case
>> the component is inside Data iteration.
>>
>> For example there is a data iteration with ui:repeat from 0 to 9, comp
>> keeps “mystate” in state helper in first index which is 0, for all other
>> iterations from 1 to 9 “mystate” will be same.
>>
>> getStateHelper().put(“mystate”, somevalue);
>>
>> <ui:repeat>
>> <my:comp />
>> </ui:repeat>
>>
>> Can’t the JSF runtime create a unique state map using client id of the
>> my:comp? So that the component can have a separate state map when we try to
>> put and get from the map.
>>
>> Or would you suggest setting the state value using client id like;
>>
>> getStateHelper().put(this.clientId + “mystate”, somevalue);
>>
>> Regards,
>>
>> Cagatay Civici
>> PrimeFaces Lead
>> PrimeTek Informatics
>> www.primefaces.or
>>
>>
>>
>>