On Tue, 09 Jul 2013 14:59:24 -0300, George Ludwig <georgelud...@gmail.com> wrote:

I've got this working pretty well now, but I want to take it to the next
level.

When the user clicks on a node of the graph, I want to trigger a callback
function on the java side. I assume this means attaching a click handler
method in javascript to the nodes...but how do I wire it up so when the js click handler is invoked, it calls a server side java method?

Easy!

@Inject
private ComponentResources resources;

...
Link eventLink = resources.createEventLink("someEventName");
...

Objet onSomeEventName() {
        ...
}

Now pass eventLink.toClientURL(); to your JavaScript code through some JavaScriptSupport method. Use this URL as the target of an AJAX request. Pass any data you want as query parameters.

--
Thiago H. de Paula Figueiredo

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

Reply via email to