Re: Loop parameter becoming null

"Thiago H. de Paula Figueiredo" <[email protected]>
Newsgroups gmane.comp.java.tapestry.user
Message-ID <CAE_88Ga+FPz8HRprR47SV92HJhRn=yOTPFYVGs3OLSUonfm21A@mail.gmail.com>
On Mon, Jan 22, 2018 at 7:49 PM, Tyler Wilcock <[email protected]> wrote:

> Hi all.


Hi!


>   I have some components being rendered in a loop.  On initial
> render, everything comes out fine.  However, when I try to click on an
> eventlink within one of the rendered components, I get an application
> exception.  What is going wrong here?
>

You're not passing any context to the remove EventLink. From your code:

<t:eventlink event="remove" class="remove-filter-icon">&times;</t:eventlink>

The request triggered by clicking the EventLink is different from the one
which rendered the HTML and Tapestry 5 doesn't keep the rendering state
between requests. You need to pass the needed information to the EventLink
so it can relay it to the corresponding event handler method.

You should add context="[reference to what you want to delete]" to your
EventLink and a corresponding parameter to onRemove().

--
Thiago
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.