On Fri, 16 Aug 2013 08:04:44 -0300, Lance Java <lance.j...@googlemail.com>
wrote:
Thiago's approach works well when the event context is known on the
server when the Link is generated. When you want to pass dynamic
clientside values (mouse location, field values etc) you either need to
use request
parameters or do some token replacement on the URL generated serverside.
I explicitly said to use query parameters to pass data. ;) In addition,
since Tapestry 5.2, you can use the @RequestParameter annotation in event
handler events instead of using Request.getParameter() and do
conversions/coercions yourself. Example:
onSomeEventName(@RequestParameter("id") User user, ...) { ... },
supposing the 'id' query parameter passed from the AJAX request is an user
id and there's a ValueEncoder registered for the User class.
Notice that the same coercions and assumptions used in normal,
non-annotated context parameters are used for @RequestParameter.
It would be nice to have a javascript function to generate event URL's.
That would need a JavaScript implementation of UrlEncoder, which is an
overridable service.
--
Thiago H. de Paula Figueiredo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org