Re: correct way to call necessary javascript initialization when a component is added via ajax

2009-11-11 Thread svenmeier
Why so complicated? @Override public void renderHead(IHeaderResponse response) { response.renderOnDomReadyJavascript(init_slider_js()); } Peter Ross-6 wrote: On Wed, Nov 11, 2009 at 3:48 PM, Jeremy Thomerson jer...@wickettraining.com wrote: On Tue, Nov 10, 2009 at 10:38 PM, Peter

Re: correct way to call necessary javascript initialization when a component is added via ajax

2009-11-11 Thread Jeremy Thomerson
Won't work on an ajax request because the dom ready event isn't fired. Right? -- Jeremy Thomerson http://www.wickettraining.com On Wed, Nov 11, 2009 at 2:23 AM, svenmeier s...@meiers.net wrote: Why so complicated? @Override public void renderHead(IHeaderResponse response) {

Re: correct way to call necessary javascript initialization when a component is added via ajax

2009-11-11 Thread mbrictson
Actually wicket-ajax.js is smart enough to fire these dom ready events after an ajax request. Of course, a jQuery $(document).ready() will not fire; neither will the ready events of other various JS libraries. However if you specifically use Wicket's dom ready event (i.e.

Re: correct way to call necessary javascript initialization when a component is added via ajax

2009-11-11 Thread Sven Meier
Right? Wrong, see explanation below. Sven mbrictson wrote: Actually wicket-ajax.js is smart enough to fire these dom ready events after an ajax request. Of course, a jQuery $(document).ready() will not fire; neither will the ready events of other various JS libraries. However if you

Re: correct way to call necessary javascript initialization when a component is added via ajax

2009-11-11 Thread Peter Ross
On Wed, Nov 11, 2009 at 7:23 PM, svenmeier wrote: Why so complicated? because I started by looking at what wiquery did and then simplifying it to my case. However I wasn't sure if it was the correct approach or the most simple hence the question is there a better solution. @Override public

correct way to call necessary javascript initialization when a component is added via ajax

2009-11-10 Thread Peter Ross
Hi, I'm implementing a control which consists of an integer field and a slider where the slider comes from jquery UI. My question is that whenever the component is refreshed via ajax, you need to call the js initialization function. I've done this by adding a behaviour which determines the

Re: correct way to call necessary javascript initialization when a component is added via ajax

2009-11-10 Thread Jeremy Thomerson
Yes - this looks fine. There are multiple ways of accomplishing it, but this one is fine. -- Jeremy Thomerson http://www.wickettraining.com On Tue, Nov 10, 2009 at 10:38 PM, Peter Ross p...@missioncriticalit.comwrote: Hi, I'm implementing a control which consists of an integer field and a

Re: correct way to call necessary javascript initialization when a component is added via ajax

2009-11-10 Thread Peter Ross
On Wed, Nov 11, 2009 at 3:48 PM, Jeremy Thomerson jer...@wickettraining.com wrote: On Tue, Nov 10, 2009 at 10:38 PM, Peter Ross p...@missioncriticalit.comwrote: Hi, I'm implementing a control which consists of an integer field and a slider where the slider comes from jquery UI. My