Which Tapestry version is this with? I think there was a change in 4.1.4-SNAPSHOT that handles the nullpointer exception when using addinitializationscript.
On the other hand, let me propose another solution that (I think) better works in your case ResponseBuilder.addStatusMessage(IMarkupWriter writer, String category, String text) - you can get the responseBuilder from the currect IRequestCycle -. When the ajax response arrives, tapestry will 'publish' the text using the given category, i.e. it will execute for you: dojo.event.topic.publish('myCategoy','myText') So, if you're subscribed to that topic, your custom js functions can be notified, i.e. dojo.event.topic.subscribe('myCategory', function(msg) { alert(msg); /* do custom processing here */ } ); I'll raise a documentation issue for this - i think i missed explaining it. On Jan 20, 2008 1:10 AM, Alp Çevik <[EMAIL PROTECTED]> wrote: > Hello all, > > I am a newbie trying to develop some app using Tapestry. I currently am > having some trouble using the ajax functionality. > > The thing is, I am trying to use some 3rd party flash charting component > (Fusion charts v2) which I would like to update when data changes. The data > is also changed by the application which contains the charts. > 1- I have to make some javascript function calls to update the chart > 2- the chart should be updated after new data is sent to the server and > processed > > I am using Directlink and update components to process the changed data on > the server, which works smoothly. The trouble is, I need to find some way to > trigger the function to update the charts after the directlink listener does > its job. > > - thought of implementing a servlet for using ajax calls within tapestry, > but as the objects tend to change, it costs a lot to overcome the > synchronization issue with tapestry & the servlet > - I have tried updateing components for the part that runs the javascript, > receiving the javascript function call as new content with ajax, which > resulted in nonworking code in IE. > - tried using contrib Xtile component, noticing that I have to be calling > the listener with this component also and handle all the ajax related stuff > which current direct link is doing > - tried using event handler annotations, which did not work as the > javascript method that starts the process on eventhandler has no relations > to the directlink listener. > - tried getting the responsebuilder and outputting the script as an > initialization script, using write..script, during which I tried to obtain > some reference to the MarkupWriter hopelessly, then tried > addinitializationscript and got a nullpointer exception that I could not > figure out, though I could get the component and stuff on debugger. > > Thank you in advance, > > Alp > -- Andreas Andreou - [EMAIL PROTECTED] - http://blog.andyhot.gr Tapestry / Tacos developer Open Source / JEE Consulting --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]