Re: Ajax based panel replacement

2012-11-25 Thread Sven Meier
Make a copy of AbstractAjaxTimerBehavior and let it be stoppable from onTimer(): diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractAjaxTimerBehavior.java b/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractAjaxTimerBehavior.java index 3071875..b982a39 100644 ---

Re: Ajax based panel replacement

2012-11-25 Thread Martin Grigorov
Hi, On Sun, Nov 25, 2012 at 9:51 AM, Sven Meier s...@meiers.net wrote: Make a copy of AbstractAjaxTimerBehavior and let it be stoppable from onTimer(): diff --git a/wicket-core/src/main/java/**org/apache/wicket/ajax/**AbstractAjaxTimerBehavior.java

Re: Ajax based panel replacement

2012-11-25 Thread Oliver Zemann
As suggested i created the JIRA issue https://issues.apache.org/jira/browse/WICKET-4886 I will test the diff tomorrow. Am 25.11.2012 15:41, schrieb Martin Grigorov: Hi, On Sun, Nov 25, 2012 at 9:51 AM, Sven Meier s...@meiers.net wrote: Make a copy of AbstractAjaxTimerBehavior and let it be

Re: Ajax based panel replacement

2012-11-25 Thread Martin Grigorov
I see now what Sven meant with the second check for isStopped(). But additionally I see that the quickstart is very broken. PanelOne does: form.add(new AbstractAjaxTimerBehavior(Duration.seconds(5)) { @Override protected void onTimer(AjaxRequestTarget target) {

Re: Ajax based panel replacement

2012-11-25 Thread Sven Meier
Of course the component should be added to the ART. But the example already fails when the behavior tries to write out the next timeout after #onTimer(). This is why I think it should re-check #isStopped(), since the user might stop the timer in #onTimer(). I'll take a look at WICKET-4886.

Re: Ajax based panel replacement

2012-11-25 Thread Martin Grigorov
diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractAjaxTimerBehavior.java b/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractAjaxTimerBehavior.java index 3071875..0651c33 100644 --- a/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractAjaxTimerBehavior.java +++

Re: Ajax based panel replacement

2012-11-25 Thread Martin Grigorov
On Sun, Nov 25, 2012 at 7:14 PM, Martin Grigorov mgrigo...@apache.orgwrote: diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractAjaxTimerBehavior.java b/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractAjaxTimerBehavior.java index 3071875..0651c33 100644 ---

Re: Ajax based panel replacement

2012-11-25 Thread Oliver Zemann
Am 25.11.2012 18:58, schrieb Martin Grigorov: I see now what Sven meant with the second check for isStopped(). But additionally I see that the quickstart is very broken. PanelOne does: form.add(new AbstractAjaxTimerBehavior(Duration.seconds(5)) { @Override protected

Re: Ajax based panel replacement

2012-11-25 Thread Sven Meier
Without the 'true ||'. Great :) Sven On 11/25/2012 07:15 PM, Martin Grigorov wrote: On Sun, Nov 25, 2012 at 7:14 PM, Martin Grigorov mgrigo...@apache.orgwrote: diff --git a/wicket-core/src/main/java/org/apache/wicket/ajax/AbstractAjaxTimerBehavior.java

Re: Ajax based panel replacement

2012-11-25 Thread Oliver Zemann
Are the changes pushed to the git repo? Or is this only a solution which will work in my case but will not be pushed because of side effects, no necessity etc.? Thanks in advance. Oli Am 25.11.2012 20:25, schrieb Sven Meier: Without the 'true ||'. Great :) Sven On 11/25/2012 07:15 PM,

Re: Ajax based panel replacement

2012-11-24 Thread Sven Meier
What is the problem? Sven On 11/24/2012 08:22 PM, Oliver Zemann wrote: Hi, i created a small wicket application to show my problem: https://github.com/olze/WicketPanelReplace The first panel gets displayed, after a few seconds it should be replaced by the second panel. Is there any way to

Re: Ajax based panel replacement

2012-11-24 Thread Oliver Zemann
The problem is that this leads to a Page not found error. The problem is that the Panel which should be replaced is still looked up in the findPage() method. But findPage() returns null on that component, so this error is thrown. Am 24.11.2012 21:48, schrieb Sven Meier: What is the problem?

Re: Ajax based panel replacement

2012-11-24 Thread Sven Meier
After the timer has fired, AbstractAjaxTimerBehavior automatically registers another timeout for the form inside PanelOne. But at that point PanelOne is no longer in the component tree, it's replaced by PanelTwo already. I'd recommend adding the behavor to the container instead: final

Re: Ajax based panel replacement

2012-11-24 Thread Oliver Zemann
Unfortunately this is not a solution as i have about 30 different panels. And i guess at least 10 of them should later use JS. With the approach you suggested i would have to check which panel should be displayed and load that (switch/case with 10 different panels). I guess that would also