You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Juan Gabriel Arias <ju...@gmail.com> on 2008/02/19 15:56:59 UTC

Restarting AjaxTimeBehavior

Hi all,
is there a way to do that? Restart the AjaxTimeBehavior?

I have a panel, that should update itself when some event occurs. So, i use
AjaxTimeBehavior to check periodically for that condition.

But i also have another component making user-fired ajax requests. And i
wanted to check my business condition and restart the interval timeout in
both cases, not only in when AjaxTimeBehavior ends its time-out period. Just
for avoiding inmediate/unnecesary ajax requests...

Looking AbstractAjaxTimerBehavior code, i saw

protected final void respond(final AjaxRequestTarget target)
{
    onTimer(target);

    if (!stopped)
    {
        target.getHeaderResponse
().renderOnLoadJavascript(getJsTimeoutCall(updateInterval));
    }
}

I belileve that i should do somethin similar... but this is all protected,
or private...

Does this make any sense for you?

regards!
Juan

Re: Restarting AjaxTimeBehavior

Posted by Juan Gabriel Arias <ju...@gmail.com>.
Ok, i'll try to do that.

Thanks!
juan

Re: Restarting AjaxTimeBehavior

Posted by Martijn Dashorst <ma...@gmail.com>.
I don't think anyone has come up with this usecase. So a JIRA would be
good, a patch better.

Martijn

On 2/20/08, Juan Gabriel Arias <ju...@gmail.com> wrote:
> Sorry, but... any ideas? Should i create an issue in jira?
>
> Thanks!
> Juan
>
> On Feb 19, 2008 12:56 PM, Juan Gabriel Arias <ju...@gmail.com> wrote:
>
> > Hi all,
> > is there a way to do that? Restart the AjaxTimeBehavior?
> >
> > I have a panel, that should update itself when some event occurs. So, i
> > use AjaxTimeBehavior to check periodically for that condition.
> >
> > But i also have another component making user-fired ajax requests. And i
> > wanted to check my business condition and restart the interval timeout in
> > both cases, not only in when AjaxTimeBehavior ends its time-out period. Just
> > for avoiding inmediate/unnecesary ajax requests...
> >
> > Looking AbstractAjaxTimerBehavior code, i saw
> >
> > protected final void respond(final AjaxRequestTarget target)
> > {
> >     onTimer(target);
> >
> >     if (!stopped)
> >     {
> >         target.getHeaderResponse
> > ().renderOnLoadJavascript(getJsTimeoutCall(updateInterval));
> >     }
> > }
> >
> > I belileve that i should do somethin similar... but this is all protected,
> > or private...
> >
> > Does this make any sense for you?
> >
> > regards!
> > Juan
> >
>


-- 
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.1

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


Re: Restarting AjaxTimeBehavior

Posted by Juan Gabriel Arias <ju...@gmail.com>.
Sorry, but... any ideas? Should i create an issue in jira?

Thanks!
Juan

On Feb 19, 2008 12:56 PM, Juan Gabriel Arias <ju...@gmail.com> wrote:

> Hi all,
> is there a way to do that? Restart the AjaxTimeBehavior?
>
> I have a panel, that should update itself when some event occurs. So, i
> use AjaxTimeBehavior to check periodically for that condition.
>
> But i also have another component making user-fired ajax requests. And i
> wanted to check my business condition and restart the interval timeout in
> both cases, not only in when AjaxTimeBehavior ends its time-out period. Just
> for avoiding inmediate/unnecesary ajax requests...
>
> Looking AbstractAjaxTimerBehavior code, i saw
>
> protected final void respond(final AjaxRequestTarget target)
> {
>     onTimer(target);
>
>     if (!stopped)
>     {
>         target.getHeaderResponse
> ().renderOnLoadJavascript(getJsTimeoutCall(updateInterval));
>     }
> }
>
> I belileve that i should do somethin similar... but this is all protected,
> or private...
>
> Does this make any sense for you?
>
> regards!
> Juan
>