You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Ambrose Wheatcroft <am...@gmail.com> on 2009/11/02 12:20:55 UTC
How can I correctly add (by Ajax) and remove (by Ajax) an
AjaxSelfUpdatingTimerBehavior?
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-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How can I correctly add (by Ajax) and remove (by Ajax) an
AjaxSelfUpdatingTimerBehavior?
Posted by Ambrose Wheatcroft <am...@gmail.com>.
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 <re...@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 <
> ambrosewheatcroft@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-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: How can I correctly add (by Ajax) and remove (by Ajax) an
AjaxSelfUpdatingTimerBehavior?
Posted by Ernesto Reinaldo Barreiro <re...@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 <
ambrosewheatcroft@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-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>