On Tue, 02 Jul 2013 17:25:14 -0300, George Ludwig <georgelud...@gmail.com>
wrote:
Thanks for the info Thiago!
Couldn't you just @Import to get the JS files included and
JavaScriptSupport.addScript() to invoke JS functions?
That's the route I ended up taking to import the necessary js files, but
I'm still unclear on exactly how to use JavaScriptSupport.addScript() to
create an instance of the sigma viewer.
Whatever you pass to addScript() is added inside a <script></script> tag
inside the HTML as is. So, if the function that sets up your code in
JavaScript is initializeGraphs(), for example, call
JavaScriptSupport.addScript("initializeGraphs()");. If you need to pass
some data to it, remember that addScript() follows the String.format()
format.
For example, I don't understand
when it's appropriate to use JavaScriptSupport.addInitializerCall()
vs. JavaScriptSupport.addScript()
Initializer calls are just another way of doing the same, a better one
than addScript(), but in a harder way. addScript() takes raw JavaScript
and adds it to the page. An initializer is a function added to the
Tapestry.Initializer object. addInitializerCall() takes the name of this
function and the value of the parameters you'll pass to it.
--
Thiago H. de Paula Figueiredo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org