you are writing out javascript after every component render... perhaps you should keep a boolean flag that marks if you rendered the js yet or not.
alternatively you can add a behavior to the panel with istemporary() { return true; } -igor On Wed, Jan 20, 2010 at 7:24 PM, Steve Swinsburg <steve.swinsb...@gmail.com> wrote: > I have an AjaxLazyLoadPanel and want some javascript to fire after its loaded > it's contents: > > I assumed I could override onAfterRender and add my javascript like so: > > add(new AjaxLazyLoadPanel("myPanel") { > > �...@override > public Component getLazyLoadComponent(String markupId) { > return new SomePamel(markupId); > } > > �...@override > protected void onAfterRender() { > JavascriptUtils.writeJavascript(getResponse(), > "alert('hello');"); > super.onAfterRender(); > } > > }); > > Except it is called twice, it looks like once when the page is loading and > then again when the actual panel has been loaded. > > Is there another way to achieve what I want? > > thanks, > Steve > > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org