Have you tried prependJavascript(String) instead of append? Javadoc: "Adds javascript that will be evaluated on the client side before components are replaced"
Sounds like what you're looking for if I'm understanding your question correctly. Craig _____ From: Daniele Dellafiore [mailto:ilde...@gmail.com] To: users@wicket.apache.org Sent: Sat, 10 Oct 2009 07:51:27 -0400 Subject: AjaxRequestTarget javascript execution order Hi. In my application I want to execute some javascript on a component that is going to be removed when a parent component is refreshed causing him to be removed from DOM. What happens is that DOM is refreshed before the script added vua target.appendJavascript(mySCript) is executed. So myScript does not find the old component. I have looked the AjaxRequestTarget.respond(final RequestCycle requestCycle) and I have seen that the onDomreadyJavascript is added before the appendJavascript. Is this relevant? I guess that the js code that refresh DOM is executed even before the onDomReadyJs, right? So how may I execute some custom javascript on a AjaxRequestTarget that also add a component to be refreshed via ART.addComponent() so that my custom js is executed before the DOM is modified? -- Daniele Dellafiore http://blog.ildella.net http://twitter.com/ildella --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org