Re: How to run some JS only once after Ajax rendering is done ?

2010-09-08 Thread Joseph Pachod
Hi have you tried invoking AjaxRequestTarget's method appendJavascript? Inside if statement try to write AjaxRequestTarget.get().appendJavascript(jQuery.initEdit();); I had a similar problem some weeks ago and it worked. It won't be run only once even if added multiple time (for

Re: How to run some JS only once after Ajax rendering is done ?

2010-09-08 Thread Joseph Pachod
Fabrice BUQUET wrote: Maybe you can try IHeaderResponse.renderOnDomReadyJavascript Thanks a lot, it did it :) It wasn't too obvious that Wicket checks in this given method for not rendering twice the same javascript. Great anyway, thanks again :) ++ joseph

Re: How to run some JS only once after Ajax rendering is done ?

2010-09-08 Thread Joseph Pachod
Bernhard Schauer wrote: I think you could do it as follows. The js function 'bindYourEvent()' is called after the the components that are added to the AjaxRequestTarget are 're-painted'. form.add(new AjaxButton(set) { @Override protected void onSubmit(final

How to run some JS only once after Ajax rendering is done ?

2010-09-07 Thread Joseph Pachod
hi I've some components which require some client side javascript which require one init call (for all) to be initialized. In fact, this init call uses selectors to get at the components to work one. My issues is with Ajax. It happens that, during it, some new components required this init

Re: How to run some JS only once after Ajax rendering is done ?

2010-09-07 Thread Fabrice BUQUET
Maybe you can try IHeaderResponse.renderOnDomReadyJavascript 2010/9/7 Joseph Pachod j...@thomas-daily.de hi I've some components which require some client side javascript which require one init call (for all) to be initialized. In fact, this init call uses selectors to get at the components

Re: How to run some JS only once after Ajax rendering is done ?

2010-09-07 Thread Andrea Del Bene
Joseph Pachod jp at thomas-daily.de writes: When trying to reach this goal, I tried to run the init call through an header contributor, but the call is then done before my content is put on the page, making it useless: public abstract class AbstractEditBehavior extends AbstractBehavior {

Re: How to run some JS only once after Ajax rendering is done ?

2010-09-07 Thread Bernhard Schauer
I think you could do it as follows. The js function 'bindYourEvent()' is called after the the components that are added to the AjaxRequestTarget are 're-painted'. form.add(new AjaxButton(set) { @Override protected void onSubmit(final AjaxRequestTarget target,