Re: load JS after page refresh

2015-04-28 Thread Chris
Perfect, thanks a lot! Chris Am 27.04.2015 um 13:21 schrieb Sven Meier s...@meiers.net: Hi, I've tried your sample project and identified the problem: Since you're adding the whole page to the AjaxRequestTarget, Wicket will immediately issue a redirect to the current page. But at

Re: load JS after page refresh

2015-04-27 Thread Martin Grigorov
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

Re: load JS after page refresh

2015-04-27 Thread Chris
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

Re: load JS after page refresh

2015-04-27 Thread Sven Meier
Hi, I've tried your sample project and identified the problem: Since you're adding the whole page to the AjaxRequestTarget, Wicket will immediately issue a redirect to the current page. But at the end of the current request, the page is detached - this removes all temporary behaviors. The

Re: load JS after page refresh

2015-04-27 Thread Martin Grigorov
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,

Re: load JS after page refresh

2015-04-27 Thread Chris
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,

Re: load JS after page refresh

2015-04-26 Thread kovaron
Hello, On the arrival page you can do it in renderHead. Isn't it good for you? chris.gr [via Apache Wicket] ml-node+s1842946n4670509...@n4.nabble.com ezt írta (időpont: 2015. ápr. 27., Hét 4:16): Hi all, how is it possible to load a JS function after a specific page refresh based on an ajax