On Tue, 20 May 2014 10:56:13 -0300, Ilya Obshadko <ilya.obsha...@gmail.com> wrote:

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 asked the template because your attempt may have gotten something wrong, and without it all we can do here is guess.

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.

The point here is that you just cannot rely on a loop variable after rendering or in event (including form submission) requests. So, in this case, you need to pass it to the context of the Submit component so you can set it again. Something like this, supposing the loop variable is an entity:

<t:submit t:id="submitControl" value=".." t:context="loopVariable.id"/>

void onSelectedFromSubmitControl(Long id) {
        loopVariable = findById(id); // retrive the original object from the id
        ...
}

Is this what you tried? If not, could you at least provide an overview of that? Otherwise, I cannot help you further.

--
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

Reply via email to