Hi,

Yes, it is possible.
You can override AjaxLazyLoadPanel's #updateAjaxAttributes() and
do attributes.setWicketAjaxResponse(true)
Then in onSuccess() check the response content (or the response header
Ajax-Location) and if it is not redirect then ask Wicket to process the
response as
https://github.com/apache/wicket/blob/master/wicket-experimental/wicket-atmosphere/src/main/java/org/apache/wicket/atmosphere/jquery.wicketatmosphere.js#L31
does.

Martin Grigorov
Wicket Training and Consulting


On Fri, Jun 20, 2014 at 5:27 PM, ygou <[email protected]> wrote:

> Hi Martin,
>
> Is there any way to stop the redirection?
>
> Our scenario is:
>
> 1. Three pages are opened at the same time, one in each browser tab.
> 2. The first one is evicted from the page store (the maximum pages for the
> page store is set to 2)
> 3. An Ajax request (initiated by AjaxLazyLoadPanel) from the first page is
> responded with "<ajax-response><redirect>..."
> 4. The first page is then redirected to somewhere else, which we don't want
> to happen.
>
> Wonder if there's any way to stop the redirection. That is, in our case, we
> don't like the AjaxLazyPanel to be loaded, just don't do anything.
>
> Can we stop the redirection in JavaScript like below:
> Wicket.Event.subscribe('/ajax/call/complete', function(jqEvent, attributes,
> jqXHR, errorThrown, textStatus) {
>       if (jqXHR != null && jqXHR.responseText != null &&
> jqXHR.responseText.match("<ajax-response><redirect>")) {
>       // Do something to stop the redirection?
>       }
>     });
>
> Or overwrite a certain method of AjaxLazyLoadPanel so as not to return
> "<ajax-response><redirect>..." as the response?
>
> Thank you,
> Yuci
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/wicket-event-ajax-call-complete-check-if-ajax-response-is-a-redirect-to-a-new-page-tp4663869p4666323.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

Reply via email to