Hi!

On Sun, 14 Feb 2010 00:10:02 -0200, Nathan Kopp <nathan.k...@gmail.com> wrote:

There are two things preventing this from working:
First, Tapestry does not replay the loop when processing the eventlink (like it did in the 3.x and 4.x days). Therefore, "fooLoopVar" never gets changed from its default of null.

Tapestry 5 doesn't have the rewind phase like previous versions had. And that's a very good thing, because it was quite complicated to understand and make it work. You should use the context parameter of EventLink and ActionLink to pass information to the event handler method.

Second, there's only one instance of  the ViewDonkeyInlineEdit component
inside the loop.

Yes. Less memory usage! The solution is the same as above.

All of the eventlink URLs look identical, so there's no
way to tell which Donkey should be edited.

See above.

I tried using the "context" parameter of the eventlink component, but since events start at the deepest level and bubble up,

It starts at the EventLink instance level, not from the deepest one.

I got the null pointerexception before I could use the context for anything useful at the outer
(page) level.

This looks like a bug in your code, most probably by working in a T4-ish way in T5.

In Test.java, I added:
    String onPassivate() {
        return fooLoopVar==null?null:fooLoopVar.getName();
    }

You shouldn't rely in a variable used as a Loop object (in this case, fooLoopVar), as T5 doesn't have a rewind phase.

Basically, I need something that works like the page activation context, but generalized to work with any component at any level of the component tree.

Inject ComponentEventLinkEncoder and use its decodePageRenderRequest(Request request) method (when rendering) or decodePageRenderRequest(Request request) (when handling an event). Both methods return an object that contains the page activation context.

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, software architect and developer, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.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