Em Thu, 02 Apr 2009 21:03:54 -0300, Jason Tan <jtan...@gmail.com> escreveu:


Unfortunately, in AJAX scenarios, the URL has to be hard-coded (though I
suppose you could write use an EventLink to render the URL as a global
variable inline in the TML, but that seems nasty).

Not quite. You can use methods from ComponentResources and some Tapestry services to generate links for you. No need to hardcode URLs.

This example is adapted from EventLink:

@Inject
private ComponentResources resources;

@Override
protected Link createMethodLink(Object[] contextArray) {
    return resources.createEventLink("yourEventName", contextArray);
}


My original question though, is whether event methods on *pages* are
acceptable,

Yes, and we use it all the time. And the difference between pages and components in Tapestry 5 is very small: pages have URLs, components have parameters, some different lifecycle events. Internally, a page is a component.

Also, I think my first and most baffling question wasn't answered, quoted
again for reference. More specifcally, are component parameters expected to be bound by the time a an embedded component's setupRender() is called, or are they only bound when beginRender() is called? My debugging investigation indicated the latter, even though the documentation indicates the former.

Try printing the parameter value instead of using the debugger. Tapestry modifies your class on-the-fly and fields with Tapestry annotations are not normal fields.

--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to