On Tue, May 20, 2014 at 5:35 PM, Thiago H de Paula Figueiredo <
thiag...@gmail.com> wrote:

> On Tue, 20 May 2014 10:26:22 -0300, Ilya Obshadko <ilya.obsha...@gmail.com>
> wrote:
>
>  Already tried this. Context provided to onSelected handler contains value
>> from the last iteration as well, so obviously that doesn't help.
>>
>
> Please post the template of this attempt.


It's too complex. The layout I provided in the first post resembles the
basic idea: we have a component wrapped by the loop, and submit control in
each component.


> I'm not persisting loop variable in a way you mean it. I'll try to
>
>> formulate the problem different: if submit element was triggered inside a
>> component enclosed by a loop, is it supposed to be handled by the SAME
>> component that contained this submit element?
>>
>
> Yep, but because a *single* instance of your component is rendered
> multiple times. Many people have the wrong impression that when a component
> is placed inside a Loop, one instance of the component will be created for
> each rendering. This is not true.


Well, that makes sense (as well as explains why providing variable instance
in submit context doesn't help). Event is handled by an instance of the
component with state corresponding to the last iteration of the loop.

I don't have an idea how to solve this.

-- 
Ilya Obshadko

Reply via email to