Build a URL using resources.createEventLink() and pass this down to the
browser.

>From the event handler, construct and return a JSONObject.

Have the client trigger the provided URL, then pass the response.json to
the fd.loadJSON() method.

There's a bunch of other variations on this; for instance, you can create a
initializer function (in 5.3) or a module (in 5.4) and pass the JSON object
to the initalize function, or the module, via JavaScriptSupport.


On Mon, Jul 15, 2013 at 4:21 PM, Daniel Jue <[email protected]> wrote:

> Hi, I'm getting back into Tapestry development, specifically needing to do
> some dynamic front end work I haven't attempted before.
>
> I have a 3rd party JS library (Infovis) which draws a graph using JSON
> data.
>
> http://philogb.github.io/jit/static/v20/Jit/Examples/ForceDirected/example1.html
>
> The starter example uses
>
> var json = "...the sample graph data.."
>
> and then later on there is call to
>
>    1. fd.loadJSON(json);
>
>
> What I'd like to do is have the user click on an action/event link and then
> have the var json variable returned from the server side, and then have
> fd.loadJSON() called.
>
> What is the most direct and preferred way of doing this? (Preferably
> without extra dependencies)
>
>
> Thanks
>



-- 
Howard M. Lewis Ship

Creator of Apache Tapestry

The source for Tapestry training, mentoring and support. Contact me to
learn how I can get you up and productive in Tapestry fast!

(971) 678-5210
http://howardlewisship.com

Reply via email to