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 WebMarkupContainer wmc = new WebMarkupContainer("container");
        wmc.add(new AbstractAjaxTimerBehavior(Duration.seconds(5)) {
            @Override
            protected void onTimer(AjaxRequestTarget target) {
                PanelTwo two = new PanelTwo("panel");
                wmc.addOrReplace(two);
                target.add(wmc);

                stop(target);
            }
        });
        add(wmc);

        wmc.add(new PanelOne("panel"));

This way you won't have to pass 'wmc' to PanelOne any longer.

Sven

On 11/24/2012 10:04 PM, Oliver Zemann wrote:
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?

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 achieve this behavior with that kind of architecture?

If not, how should a ajax based panel wizard work? Any recommendations?

Thanks in advance.

Oli

---------------------------------------------------------------------
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



---------------------------------------------------------------------
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

Reply via email to