See jolira-tools Wicket Ajax stateless components and behaviors. You'll have to roll your own timer behavior.
On Wed, Sep 7, 2011 at 6:20 PM, Sylvain Vieujot <svieu...@apache.org> wrote: > The component is indeed stateless, but adding the > AjaxSelfUpdatingTimerBehavior prevents it to staying stateless and generates > an exception like : > > Last cause: '[Header [Component id = header]]' claims to be stateless but > isn't. Possible reasons: no stateless hint, statefull behaviors > > WicketMessage: Error attaching this container for rendering: [Page class = > com.windsOfDubai.web.HomePage, id = 2, render count = 1] > > I am trying to add the self updating behaviour whilst keeping the page > stateless. > > > On Wed, 2011-09-07 at 15:09 +0300, Martin Grigorov wrote: > > Hi, > > A Component (inc. Page) is stateless by nature. > > On Wed, Sep 7, 2011 at 11:51 AM, Sylvain Vieujot > <sylvain.vieu...@gmail.com> wrote: >> Hello, >> >> I have a stateless page, and I would like to periodically refresh a >> section >> of this page. >> If I do : >> >> add( new MyPanel( "header" ) >> .setOutputMarkupId( true ) >> .add( new AjaxSelfUpdatingTimerBehavior( Duration.minutes( 2 ) ) >> ); >> >> The page becomes stateless. > Adding Ajax**Behavior to it makes it stateful because this behavior > needs to do the callback (onTimer() in your case) >> >> If in MyPanel, I have : >> class MyPanel{ >> ... >> @Override >> public boolean getStatelessHint(@SuppressWarnings( "unused" ) >> Component >> component) { >> return true; >> } > This makes no difference, since this is the default. > See org.apache.wicket.Component.getStatelessHint() > > But the actual method that decides whether a component is stateless > is: org.apache.wicket.Component.isStateless() >> ... >> } >> >> The update does not work as the expected component's HTML id does not >> remain >> constant : >> >> Wicket.Ajax: Wicket.Ajax.Call.processComponent: Component with id >> [[header2]] was not found while trying to perform markup update. Make sure >> you called component.setOutputMarkupId(true) on the component whose markup >> you are trying to update. console.error('Wicket.Ajax: ' + msg); >> I also tried to use .setVersioned( false ) on both the component and the >> page, but without success. >> Is there a way to do this ? >> >> Thank you, >> >> Sylvain. > > > > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org