How can I correctly add (by Ajax) and remove (by Ajax) an AjaxSelfUpdatingTimerBehavior?

2009-11-02 Thread Ambrose Wheatcroft
Hello,

Is it possible to correctly add and then remove an
AjaxSelfUpdatingTimerBehavior from a component, all by Ajax?  At the
moment I'm running into problems - the browser gets a Page Expired
response soon after I remove the behavior.  I think I have an idea why
it doesn't work in its current form - is there any way to get
something similar working?

Thanks,
Ambrose

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: How can I correctly add (by Ajax) and remove (by Ajax) an AjaxSelfUpdatingTimerBehavior?

2009-11-02 Thread Ernesto Reinaldo Barreiro
Remember having the same problem with panel and I have dome something like

for(Object behavior : getBehaviors()) {
if(behavior instanceof AjaxSelfUpdatingTimerBehavior) {
remove((AjaxSelfUpdatingTimerBehavior)behavior);
}
}
add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(1000)));
So, that refresh is delayed a lot... but now that I look to it again I see
there is an stop() method on AbstractAjaxTimerBehavior.

Regards,

Ernesto

On Mon, Nov 2, 2009 at 12:20 PM, Ambrose Wheatcroft 
ambrosewheatcr...@gmail.com wrote:

 Hello,

 Is it possible to correctly add and then remove an
 AjaxSelfUpdatingTimerBehavior from a component, all by Ajax?  At the
 moment I'm running into problems - the browser gets a Page Expired
 response soon after I remove the behavior.  I think I have an idea why
 it doesn't work in its current form - is there any way to get
 something similar working?

 Thanks,
 Ambrose

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: How can I correctly add (by Ajax) and remove (by Ajax) an AjaxSelfUpdatingTimerBehavior?

2009-11-02 Thread Ambrose Wheatcroft
Okay,

So I got it working.  As you suggest - stop() works.  I then also
store the behavior so that it can be removed permanently on a later
Ajax trip.  That way I can keep adding and removing timers with
different intervals.

Thanks!

2009/11/2 Ernesto Reinaldo Barreiro reier...@gmail.com:
 Remember having the same problem with panel and I have dome something like

 for(Object behavior : getBehaviors()) {
 if(behavior instanceof AjaxSelfUpdatingTimerBehavior) {
 remove((AjaxSelfUpdatingTimerBehavior)behavior);
 }
 }
 add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(1000)));
 So, that refresh is delayed a lot... but now that I look to it again I see
 there is an stop() method on AbstractAjaxTimerBehavior.

 Regards,

 Ernesto

 On Mon, Nov 2, 2009 at 12:20 PM, Ambrose Wheatcroft 
 ambrosewheatcr...@gmail.com wrote:

 Hello,

 Is it possible to correctly add and then remove an
 AjaxSelfUpdatingTimerBehavior from a component, all by Ajax?  At the
 moment I'm running into problems - the browser gets a Page Expired
 response soon after I remove the behavior.  I think I have an idea why
 it doesn't work in its current form - is there any way to get
 something similar working?

 Thanks,
 Ambrose

 -
 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