hi thiago, i've added the configuration inside my AppModule for the javascript: i 've actually implemented the tree inside my class,
@AfterRender public void afterRender() { String jsString = ""; jsString += "Event.observe(window,'load',function(){"; jsString += " treeObj = new JSDragDropTree(); "; jsString += " treeObj.setTreeId('bststruct'); "; jsString += " treeObj.setImageFolder('../images/'); "; jsString += " treeObj.setRenameAllowed(false); "; jsString += " treeObj.setDeleteAllowed(false); "; jsString += " treeObj.initTree(); "; renderSupport.addScript(String.format(jsString)); } next is what about in the tml page? inside the tml should have some code to linked the renderSupport? i'm totally confused about this as what to write within the tml page of mine. on the example, it wrote the script right inside the body content as :- <t:Tree treeid='literal:bststruct' source="treeNodes" currentNode="node"> <t:actionlink t:id="tree" context="node.identifier"> ${node.name} </t:actionlink> </t:Tree> <script type="text/javascript"> treeObj = new JSDragDropTree(); treeObj.setTreeId('bststruct'); treeObj.setImageFolder('../images/'); treeObj.setRenameAllowed(false); treeObj.setDeleteAllowed(false); treeObj.initTree(); </script> please advise, wesley Thiago H. de Paula Figueiredo wrote: > > Em Wed, 04 Feb 2009 14:20:58 -0300, wesleywj2 <wesley...@yahoo.co.uk> > escreveu: > >> hi thiago, > > Hi! > >> thanks for the quick reply, btw; after putting that annotation on the >> page class; > > Put it on your component class, so everytime you use your component > Tapestry will include the needed Javascript files. > > By Tapestry default, the Javascript includes are made at the bottom of the > page. You can change this in you AppModule.contributeApplicationDefaults() > method setting the tapestry.script-at-top configuration to true (more > information at http://tapestry.apache.org/tapestry5/guide/conf.html). > > By the way, that tree example does not follow the recomended way of using > Javascript in Tapestry. This page explains it very nicely: > http://wiki.apache.org/tapestry/Tapestry5AndJavaScriptExplained. Advice: > use RenderSupport to add Javascript snippets to your page, not <script> > blocks. ;) > > -- > Thiago H. de Paula Figueiredo > Independent Java consultant, developer, and instructor > http://www.arsmachina.com.br/thiago > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > > > -- View this message in context: http://www.nabble.com/how-to-use-%40IncludeJavaScriptLibrary-to-include-more-than-1-library-in-page-tp21834042p21836386.html Sent from the Tapestry - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org