Thank you. Original LinkSubmit has exactly the same issue.

On Sunday, August 25, 2013, Michael Gentry wrote:

> Hi Ilya,
>
> I was struggling with the same exact problem yesterday.  Apparently
> the AjaxFormLoop doesn't work like a regular Loop and the submit
> handler always receives the last iteration value/context.  Even using
> t:defer on the Submit didn't help.  I ended up using a LinkSubmit*
> with some CSS to make it look like a button and enough t:context
> parameters to allow me to figure out which "button" was being clicked
> on.
>
> mrg
>
> * We have our own custom version of LinkSubmit (which I didn't write,
> but is based upon the original) which has a comment at the top about
> making LinkSubmit handle t:context correctly in loops.  I don't know
> if that was an old issue which is resolved now or if it will impact
> you, but wanted to mention it in case LinkSubmit doesn't work for you.
>
>
> On Sat, Aug 24, 2013 at 8:32 AM, Ilya Obshadko 
> <[email protected]<javascript:;>>
> wrote:
> > I have t:ajaxformloop iterating over a property and t:submit using
> context
> > values from the loop. Code looks like:
> >
> > @Property
> > private SomeType iteratedValue;
> >
> > void onSelectedFromDoSomething ( SomeType iteratedValue ) {
> >   // some stuff depends on iteratedValue here
> > }
> >
> > ----
> >
> > <t:zone t:id="zoneName">
> > <t:ajaxformloop p:source="source" p:value="iteratedValue">
> >   <!-- some code here -->
> >   <t:submit t:id="doSomething" p:context="iteratedValue"
> p:zone="zoneName"/>
> >   <!-- some code there -->
> > </t:ajaxformloop>
> > </t:zone>
> >
> > At the time of submit iteratedValue *always* contains last iterated value
> > from the loop. Apparently I'm getting wrong results in the end: no matter
> > where submit was clicked, handler always receives the value from the last
> > loop iteration. Any hints how to fix this?
> >
> >
> > --
> > Ilya Obshadko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]<javascript:;>
> For additional commands, e-mail: [email protected]<javascript:;>
>
>

-- 
Ilya Obshadko

Reply via email to