I understand - I just made a quick start project with the code below that shows when setting isTemporary=true JS is not called. https://github.com/cat1000/loadjs <https://github.com/cat1000/loadjs>
If anyone can point me to the error, it would be great. Thanks, Chris > Am 27.04.2015 um 10:59 schrieb Martin Grigorov <mgrigo...@apache.org>: > > I am not sure what problem you face but it should be 'true'. > Otherwise the behavior remains attached to the page and any following > re-renderings of the page will execute this JS code again. > > Martin Grigorov > Wicket Training and Consulting > https://twitter.com/mtgrigorov > > On Mon, Apr 27, 2015 at 11:52 AM, Chris <chris...@gmx.at> wrote: > >> Hi all, >> >> thanks Martin. I have to set isTemporary=false, otherwise the JS will not >> be called. >> >> >> public void onClick(AjaxRequestTarget target) { >> target.add(getPage().add(new Behavior() { >> @Override >> public void renderHead(Component component, >> IHeaderResponse response) { >> super.renderHead(component, response); >> >> response.render(OnDomReadyHeaderItem.forScript("call...")); >> } >> >> @Override >> public boolean isTemporary(Component component) { >> return false; >> } >> })); >> >> } >> >> >> Chris >> >>> Am 27.04.2015 um 08:49 schrieb Martin Grigorov <mgrigo...@apache.org>: >>> >>> Hi, >>> >>> You can create a Behavior with #renderHead() to render the JS and >>> #isTemporary() {return true} so that it is removed automatically after >> the >>> rendering. >>> Add this Behavior in #onClick() to the page. >>> >>> Martin Grigorov >>> Wicket Training and Consulting >>> https://twitter.com/mtgrigorov >>> >>> On Mon, Apr 27, 2015 at 5:15 AM, Chris <chris...@gmx.at> wrote: >>> >>>> Hi all, >>>> >>>> how is it possible to load a JS function after a specific page refresh >>>> based on an ajax link click? >>>> >>>> Link link = new AjaxFallbackLink("link") { >>>> @Override >>>> public void onClick(AjaxRequestTarget target) { >>>> target.add(getPage()); >>>> } >>>> }; >>>> >>>> Thanks, Chris >>>> --------------------------------------------------------------------- >>>> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >>>> For additional commands, e-mail: users-h...@wicket.apache.org >>>> >>>> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org >> For additional commands, e-mail: users-h...@wicket.apache.org >> >>