You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Ernesto Reinaldo Barreiro <re...@gmail.com> on 2016/01/13 09:59:37 UTC

cancel AJAX request while a new one is triggered

Hi,

Happy 2016 to all wicketeers!

Going to business: is there a way to cancel an ongoing AJAX request when a
new one is triggered? This last thing conditional (i.e. not for all new
AJAX requests but certain). Is using a different channel enough?

Thanks in advance

-- 
Regards - Ernesto Reinaldo Barreiro

Re: cancel AJAX request while a new one is triggered

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Thanks for the pointer... I guess that's just one part of the thing as page
will still be blocked by previous request ate server side

On Thu, Jan 14, 2016 at 11:24 AM, niestroj <rn...@go2.pl> wrote:

> Take a look at AjaxChannel's:
>
> https://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/ajax/AjaxChannel.html
> . I think this might be somethign for you:
>
> https://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/ajax/AjaxChannel.Type.html#DROP
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/cancel-AJAX-request-while-a-new-one-is-triggered-tp4673284p4673327.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
>
>


-- 
Regards - Ernesto Reinaldo Barreiro

Re: cancel AJAX request while a new one is triggered

Posted by niestroj <rn...@go2.pl>.
Take a look at AjaxChannel's:
https://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/ajax/AjaxChannel.html
. I think this might be somethign for you:
https://ci.apache.org/projects/wicket/apidocs/6.x/org/apache/wicket/ajax/AjaxChannel.Type.html#DROP

--
View this message in context: http://apache-wicket.1842946.n4.nabble.com/cancel-AJAX-request-while-a-new-one-is-triggered-tp4673284p4673327.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: cancel AJAX request while a new one is triggered

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Thanks again!

One "solution" on my use case is

1- Make wicket "search" AJAX request very lightweight. Just retrieving
"empty shells" to be populated later on
2- Used Client side JS + JSON mounted resources to draw the more heavy
panels.



On Wed, Jan 13, 2016 at 10:37 AM, Martin Grigorov <mg...@apache.org>
wrote:

> On Wed, Jan 13, 2016 at 10:18 AM, Ernesto Reinaldo Barreiro <
> reiern70@gmail.com> wrote:
>
> > Hi Martin!
> >
> > Thanks for the supper fast answer! What I need is something like
> >
> > 1- On client side: you say stop this request and by doing so I unlock the
> > page and make it ready to accept new AJAX request
> > 2- Fire a new AJAX request
> >
> >
> > > Wicket's AjaxChannels manage the waiting requests only. Once a request
> is
> > > fired you cannot do anything.
> > >
> > > I see. I will still have a server side lock on the page from previous
> > request? I guess... So, my new AJAX request (on a new channel) will not
> > fire till server side finish rendering first request :-(
> >
>
> That's correct!
>
>
> >
> >
> > > Martin Grigorov
> > > Wicket Training and Consulting
> > > https://twitter.com/mtgrigorov
> > >
> > > On Wed, Jan 13, 2016 at 9:59 AM, Ernesto Reinaldo Barreiro <
> > > reiern70@gmail.com> wrote:
> > >
> > > > Hi,
> > > >
> > > > Happy 2016 to all wicketeers!
> > > >
> > > > Going to business: is there a way to cancel an ongoing AJAX request
> > when
> > > a
> > > > new one is triggered? This last thing conditional (i.e. not for all
> new
> > > > AJAX requests but certain). Is using a different channel enough?
> > > >
> > > > Thanks in advance
> > > >
> > > > --
> > > > Regards - Ernesto Reinaldo Barreiro
> > > >
> > >
> >
> >
> >
> > --
> > Regards - Ernesto Reinaldo Barreiro
> >
>



-- 
Regards - Ernesto Reinaldo Barreiro

Re: cancel AJAX request while a new one is triggered

Posted by Martin Grigorov <mg...@apache.org>.
On Wed, Jan 13, 2016 at 10:18 AM, Ernesto Reinaldo Barreiro <
reiern70@gmail.com> wrote:

> Hi Martin!
>
> Thanks for the supper fast answer! What I need is something like
>
> 1- On client side: you say stop this request and by doing so I unlock the
> page and make it ready to accept new AJAX request
> 2- Fire a new AJAX request
>
>
> > Wicket's AjaxChannels manage the waiting requests only. Once a request is
> > fired you cannot do anything.
> >
> > I see. I will still have a server side lock on the page from previous
> request? I guess... So, my new AJAX request (on a new channel) will not
> fire till server side finish rendering first request :-(
>

That's correct!


>
>
> > Martin Grigorov
> > Wicket Training and Consulting
> > https://twitter.com/mtgrigorov
> >
> > On Wed, Jan 13, 2016 at 9:59 AM, Ernesto Reinaldo Barreiro <
> > reiern70@gmail.com> wrote:
> >
> > > Hi,
> > >
> > > Happy 2016 to all wicketeers!
> > >
> > > Going to business: is there a way to cancel an ongoing AJAX request
> when
> > a
> > > new one is triggered? This last thing conditional (i.e. not for all new
> > > AJAX requests but certain). Is using a different channel enough?
> > >
> > > Thanks in advance
> > >
> > > --
> > > Regards - Ernesto Reinaldo Barreiro
> > >
> >
>
>
>
> --
> Regards - Ernesto Reinaldo Barreiro
>

Re: cancel AJAX request while a new one is triggered

Posted by Ernesto Reinaldo Barreiro <re...@gmail.com>.
Hi Martin!

Thanks for the supper fast answer! What I need is something like

1- On client side: you say stop this request and by doing so I unlock the
page and make it ready to accept new AJAX request
2- Fire a new AJAX request


> Wicket's AjaxChannels manage the waiting requests only. Once a request is
> fired you cannot do anything.
>
> I see. I will still have a server side lock on the page from previous
request? I guess... So, my new AJAX request (on a new channel) will not
fire till server side finish rendering first request :-(


> Martin Grigorov
> Wicket Training and Consulting
> https://twitter.com/mtgrigorov
>
> On Wed, Jan 13, 2016 at 9:59 AM, Ernesto Reinaldo Barreiro <
> reiern70@gmail.com> wrote:
>
> > Hi,
> >
> > Happy 2016 to all wicketeers!
> >
> > Going to business: is there a way to cancel an ongoing AJAX request when
> a
> > new one is triggered? This last thing conditional (i.e. not for all new
> > AJAX requests but certain). Is using a different channel enough?
> >
> > Thanks in advance
> >
> > --
> > Regards - Ernesto Reinaldo Barreiro
> >
>



-- 
Regards - Ernesto Reinaldo Barreiro

Re: cancel AJAX request while a new one is triggered

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

There is no way to abort/cancel the Ajax request.
XmlHttpRequest has a method for this but it will just close the connection.
The http worker thread at the server will continue to do its job and
finally will fail with IOException complaining that the connection is
closed and it cannot write its response.

Wicket's AjaxChannels manage the waiting requests only. Once a request is
fired you cannot do anything.

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

On Wed, Jan 13, 2016 at 9:59 AM, Ernesto Reinaldo Barreiro <
reiern70@gmail.com> wrote:

> Hi,
>
> Happy 2016 to all wicketeers!
>
> Going to business: is there a way to cancel an ongoing AJAX request when a
> new one is triggered? This last thing conditional (i.e. not for all new
> AJAX requests but certain). Is using a different channel enough?
>
> Thanks in advance
>
> --
> Regards - Ernesto Reinaldo Barreiro
>