EventLink must have its zone parameter set to a zone for it to use ajax. Remember not to use an empty zone(because of a bug in 5.3). If you want to use an empty zone just add to it.
On 16-Jul-2013, at 6:30 AM, Daniel Jue <teamp...@gmail.com> wrote: > Thanks Taha and Howard! Looks like I have some more learning to do, which > is always great. > BTW, I'm on T5.3.6. > > > Howard, for my purposes the JSON payload for the visualization needs to be > generated at runtime when the user clicks (I'll eventually have dozens of > clickable links, each one a costly calculation)--your solution sounds like > the json is getting pre-calculated (unless I am interpreting it wrong, > which is likely) > > I was trying one of Taha's old examples that seemed similar ( > http://apache-tapestry-mailing-list-archives.1045711.n5.nabble.com/Updating-a-page-with-a-JSONObject-td3339940.html > ) > But I'm getting an error with that. Possibly because I'm trying to trigger > the Ajax response through an eventlink I added to the TML, with no Zone. > Do I need to make use of a zone component at all? I'm getting an > error of "Page > must be specified before initializing for partial page render." > > > > > On Mon, Jul 15, 2013 at 7:30 PM, Howard Lewis Ship <hls...@gmail.com> wrote: > >> 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 <teamp...@gmail.com> 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 >> --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org