You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by fachhoch <fa...@gmail.com> on 2014/08/27 19:45:48 UTC

identify if request is from AbstractAjaxTimerBehavior in /ajax/call/beforesend

how to identify the ajax request  originated due to 
AbstractAjaxTimerBehavior  in   /ajax/call/beforeSend  event?
I am adding  AbstractAjaxTimerBehavior   to my page  and would like to
identify in beforesend function if the request originated due to timer in
AbstractAjaxTimerBehavior   ?


--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/identify-if-request-is-from-AbstractAjaxTimerBehavior-in-ajax-call-beforesend-tp4667186.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: identify if request is from AbstractAjaxTimerBehavior in /ajax/call/beforesend

Posted by fachhoch <fa...@gmail.com>.
Thank You.

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/identify-if-request-is-from-AbstractAjaxTimerBehavior-in-ajax-call-beforesend-tp4667186p4667225.html
Sent from the Users forum mailing list archive at Nabble.com.

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


Re: identify if request is from AbstractAjaxTimerBehavior in /ajax/call/beforesend

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

One way is to provide beforeSend hook for this specific ajax behavior:
attributes.getAjaxCallListeners().add(new
AjaxCallListener().onBeforeSend("YOUR CODE HERE")).

Another way is to set a custom query parameter that will help you recognize
it in the global ajax listener:
1) either override #getCallbackUrl() { return super.getCallbackUrl() +
"&isMyTimer=true"; }
2) or use attributes.getExtraParameters().put("isMyTimer", "true")

Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov


On Wed, Aug 27, 2014 at 8:45 PM, fachhoch <fa...@gmail.com> wrote:

> how to identify the ajax request  originated due to
> AbstractAjaxTimerBehavior  in   /ajax/call/beforeSend  event?
> I am adding  AbstractAjaxTimerBehavior   to my page  and would like to
> identify in beforesend function if the request originated due to timer in
> AbstractAjaxTimerBehavior   ?
>
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/identify-if-request-is-from-AbstractAjaxTimerBehavior-in-ajax-call-beforesend-tp4667186.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>