Stateless page with an auto update section

2011-09-07 Thread Sylvain Vieujot
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. If in MyPanel,

Stateless page with an auto update section

2011-09-07 Thread Sylvain Vieujot
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. If in MyPanel,

Re: Stateless page with an auto update section

2011-09-07 Thread Martin Grigorov
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 )    

Re: Stateless page with an auto update section

2011-09-07 Thread Sylvain Vieujot
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

Re: Stateless page with an auto update section

2011-09-07 Thread Martin Grigorov
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

Re: Stateless page with an auto update section

2011-09-07 Thread Igor Vaynberg
use something like this [1] as a base and build your own timer behavior [1] https://github.com/jolira/wicket-stateless/blob/master/stateless/src/main/java/com/google/code/joliratools/StatelessAjaxEventBehavior.java -igor On Wed, Sep 7, 2011 at 3:36 AM, Sylvain Vieujot svieu...@apache.org

Re: Stateless page with an auto update section

2011-09-07 Thread Sylvain Vieujot
I will look at this. Thank you. On Wed, 2011-09-07 at 08:34 -0700, Igor Vaynberg wrote: use something like this [1] as a base and build your own timer behavior [1]

Re: Stateless page with an auto update section

2011-09-07 Thread Sylvain Vieujot
I looked at this code, but it does not really help as it has to bind to an event, whilst I am trying to do an auto update component. I have 2 questions : 1) Why does the AbstractAjaxBehavior sets the getStatelessHint to false ? It seems to me that this non stateless hint could be set much lower

Re: Stateless page with an auto update section

2011-09-07 Thread Igor Vaynberg
On Wed, Sep 7, 2011 at 10:11 AM, Sylvain Vieujot svieu...@apache.org wrote: I looked at this code, but it does not really help as it has to bind to an event, whilst I am trying to do an auto update component. I have 2 questions : 1) Why does the AbstractAjaxBehavior sets the getStatelessHint

Re: Stateless page with an auto update section

2011-09-07 Thread Sylvain Vieujot
On Wed, 2011-09-07 at 10:19 -0700, Igor Vaynberg wrote: On Wed, Sep 7, 2011 at 10:11 AM, Sylvain Vieujot svieu...@apache.org wrote: I looked at this code, but it does not really help as it has to bind to an event, whilst I am trying to do an auto update component. I have 2 questions :

Re: Stateless page with an auto update section

2011-09-07 Thread Martin Grigorov
Session#nextSequenceValue() is public and non-final. You can override it in YourWebSession to do whatever fits for your needs. On Wed, Sep 7, 2011 at 9:35 PM, Sylvain Vieujot svieu...@apache.org wrote: ** On Wed, 2011-09-07 at 10:19 -0700, Igor Vaynberg wrote: On Wed, Sep 7, 2011 at 10:11

Re: Stateless page with an auto update section

2011-09-07 Thread Igor Vaynberg
On Wed, Sep 7, 2011 at 11:35 AM, Sylvain Vieujot svieu...@apache.org wrote: On Wed, 2011-09-07 at 10:19 -0700, Igor Vaynberg wrote: On Wed, Sep 7, 2011 at 10:11 AM, Sylvain Vieujot svieu...@apache.org wrote: I looked at this code, but it does not really help as it has to bind to an event,

Re: Stateless page with an auto update section

2011-09-07 Thread Sylvain Vieujot
Using the session does not work, but using the RequestCycle works fine. Below is how I solved the problem, and it seems to work quite well for stateless pages. Thank you for your help. public class StatelessAjaxSelfUpdatingTimerBehavior extends AjaxSelfUpdatingTimerBehavior { private