Already tried this. Context provided to onSelected handler contains value
from the last iteration as well, so obviously that doesn't help.

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?



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

> On Tue, 20 May 2014 10:05:11 -0300, Ilya Obshadko <ilya.obsha...@gmail.com>
> wrote:
>
>  Regardless of which submit is clicked, the event is triggered only on the
>> last component in the loop. I know that p:defer parameter is supposed to
>> handle this, but adding p:defer="false" doesn't help. Any ideas how to
>> handle this?
>>
>
> Try using the context parameter of the Submit component so you can pass
> some value so your event handler method knows which object to work on.
> Remember: the event is a different request from the one that renders HTML,
> so everything which isn't persisted (and you should avoid this) is lost.
> Using the context parameter is storing the information in an URL inside the
> generated HTML. You're probably persisting the loop variable, otherwise
> you'd just get an NPE when accessing it.
>
> The defer parameter doesn't do what you think it does and wouldn't fix the
> cause of your issue, which is not providing the context for your Submit
> component.
>
> --
> Thiago H. de Paula Figueiredo
> Tapestry, Java and Hibernate consultant and developer
> http://machina.com.br
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>
>


-- 
Ilya Obshadko

Reply via email to