On Fri, 16 Aug 2013 06:46:28 -0300, Martin Kersten
<[email protected]> wrote:
I investigated the cometd yesterday and today. The maven repository was
broken for this one. Since the last commit is half a year old, I think it
is not maintained anymore. I currently at the moment try to do the same
but
using atmosphere instead if this is not working I will try to redo the
cometd implementation myself.
Are their other (more tapestry like) ways to talk to your js components
directly?
1) Create a Link (which is basically an URL) for your own event by
@Inject'ing ComponentResources and using its createEventLink() method.
Let's suppose your event name is XXX, so
componentResources.createEventLink("XXX");
2) Create an event handler for it: JSONObject onXXX() {...}. The return
value will depend on what you want to be done after the event was handled.
JSONObject is a Java representation of a JavaScript object in JSON
notation. @Inject Request and request.getParameter("name") for getting
query parameters.
3) Pass the link created in step 2 to your JavaScript code. The easier way
is @Inject'ing JavaScriptSupport and using its addScript() method, which
can be invoked, for example, in an afterRender() method (beforeRender() or
setupRender() also works).
4) In your JavaScript code, use the link (URL) above as the target of an
AJAX request and pass any information you need as query parameters.
--
Thiago H. de Paula Figueiredo
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]