You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by Daniel Stoch <da...@gmail.com> on 2011/12/02 11:46:32 UTC

AbstractAjaxTimerBehavior with restart ability

Hi,

Current implementation of AbstractAjaxTimerBehavior has a
functionality to stop() pooling. But once stopped it cannot be
restarted. There are situations when we want to periodically refresh
components from one event to another, but not all the time (to avoid
unnecessary requests to server). So it would be nice to have a
restarting ability in AbstractAjaxTimerBehavior. Something like:

  public final void start(final AjaxRequestTarget target) {
    target.getHeaderResponse().renderOnLoadJavascript(getJsTimeoutCall(getUpdateInterval()));
  }

But this method does not work in all situations. Eg. when you stopped
this timer using stop() method, the above start() does not work (but
this is probably because a stopped flag cannot be reset to false).

What do you think about such improvement in AbstractAjaxTimerBehavior?
It would be great to has it also in 1.4 because I cannot upgrade to
1.5 ;).

--
Daniel

Re: AbstractAjaxTimerBehavior with restart ability

Posted by Martin Grigorov <mg...@apache.org>.
Hi,

There is a ticket with attached patch about this in our Jira.
Unfortunately it requires API change and that's why it waits for 1.6.

Igor mentioned once that the behavior can be reworked to stop/start
depending on Behavior#isEnabled(Component).
Find the ticket, play with #isEnabled and if it works and there are no
API breaks then we may add it in 1.5.

The next release of 1.4.x will be the last one. We have no date yet
but there wont be more after it. So we try to avoid making changes
there because they may introduce problems ...

On Fri, Dec 2, 2011 at 11:46 AM, Daniel Stoch <da...@gmail.com> wrote:
> Hi,
>
> Current implementation of AbstractAjaxTimerBehavior has a
> functionality to stop() pooling. But once stopped it cannot be
> restarted. There are situations when we want to periodically refresh
> components from one event to another, but not all the time (to avoid
> unnecessary requests to server). So it would be nice to have a
> restarting ability in AbstractAjaxTimerBehavior. Something like:
>
>  public final void start(final AjaxRequestTarget target) {
>    target.getHeaderResponse().renderOnLoadJavascript(getJsTimeoutCall(getUpdateInterval()));
>  }
>
> But this method does not work in all situations. Eg. when you stopped
> this timer using stop() method, the above start() does not work (but
> this is probably because a stopped flag cannot be reset to false).
>
> What do you think about such improvement in AbstractAjaxTimerBehavior?
> It would be great to has it also in 1.4 because I cannot upgrade to
> 1.5 ;).
>
> --
> Daniel
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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