Hi,

the AjaxSelfUpdatingBehavior makes the page stateful - without it the refresh will serve a new page instance with an up-to-date counter.

To make this work for a stateful page, you should use a model that provides the current counter to the label:

        add(new Label("myCounter", new AbstractReadOnlyModel<Integer>() {
            @Override
            public Integer getObject()
            {
                Object o = getApplication();
                if (o instanceof WicketApplication) {
                    WicketApplication w = (WicketApplication)o;
                    return w.getCounter().get();
                }
                return null;
            }
        }));

Have fun
Sven

On 20.09.2015 21:48, eostermueller wrote:
Hello all,

I just created a wicket quickstart here:

https://github.com/eostermueller/selfUpdating

I added a AjaxSelfUpdatingTimerBehavior that kind of breaks the browser
refresh.
The details are on the README.md.

I found a number of similar issues on the forum but none quite match this.

Thanks,
--Erik


--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/AjaxSelfUpdatingTimerBehavior-breaks-browser-refresh-tp4671997.html
Sent from the Users forum mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to