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 <[email protected]> wrote: > > 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 > > <[email protected]> wrote: > >> On Tue, Nov 10, 2009 at 10:38 PM, Peter Ross > >> <[email protected]>wrote: > >> > >>> 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 request > >>> target, if it's an AjaxRequestTarget it adds the init js to the target > >>> otherwise it outputs it in the header. > >>> > >>> Is this the correct way to do it? Is there a simpler way? > >>> > >> Yes - this looks fine. There are multiple ways of accomplishing it, but > >> this one is fine. > >> > > Could you elaborate on what some of the other ways are? > > > > Just enough key words so that I can do the google search would be fine :) > > > > Peter > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > > > > > > -- > View this message in context: > http://old.nabble.com/correct-way-to-call-necessary-javascript-initialization-when-a--component-is-added-via-ajax-tp26295973p26297483.html > Sent from the Wicket - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
