Hi
You can use AjaxResponseRenderer and pass the variable to an initializer method
(which you have to write in javascript).
@Inject
private AjaxResponseRenderer ajaxResponseRenderer;
@OnEvent("eventLinkEventName")
void myEventHandler(){
ajaxResponseRenderer.addCallback(new JavaScriptCallback(){
public void run(JavaScriptSupport javascriptSupport){
JSONObject spec = new JSONObject();
fill_spec_with_json();
javaScriptSupport.addInitializerCall("MyInitializerMethod", spec);
}
});
}
P.S. : Code Not Tested
regards
Taha
On 16-Jul-2013, at 4:51 AM, 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
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]