Hi, I see no solution for your case. Using BookmarkablePageLink works as you confirmed but I'm not aware of clean way to cancel running Ajax requests and replace them with completely new one.
XMLHttpRequest has #abort() method which cancels the request but this will lead co "socket close exception"s in the server side. The best approach I see is to use the same AjaxChannel name for all LazyLoadPanels and the AjaxLinks. The LazyLoadPanels should use type QUEUE and the AjaxLinks - type DROP. This way all LazyLoadPanels will load sequencially and if you click an AjaxLink it will cancel all pending LazyLoadPanels and will schedule the execution of the AjaxLink after the end of the currently loading LazyLoadPanel HTH On Thu, Nov 10, 2011 at 10:37 AM, Michal Wegrzyn <[email protected]> wrote: > Hi, > > Could you please tell me what is the status of this issue? > Should I create a Jira issue and/or quickstart or is it won't fix/invalid? > > Best regards, > Michal Wegrzyn > >> -----Original Message----- >> From: Michal Wegrzyn [mailto:[email protected]] >> Sent: Friday, November 04, 2011 11:56 >> To: [email protected] >> Subject: RE: abort loading lazy components >> >> Thanks for an update Martin. >> >> Unfortunately using IAjaxCallDecorator#decorateScript() prevents >> handling request (nothing happens). >> If I append the stop script directly to ajax request target (before >> sending event), then request proceeds, but the first lazy component is >> not loaded. >> >> Also, the stop script breaks ajax indicators (both from lazy components >> and indicating links). Exceptions still are present, but page isn't >> crashing. >> >> So far the closest solution was using BookmarkablePageLink, but it is >> not ajax and it is just a workaround. >> >> Isn't there a way to prevent Wicket from handling "old" ajax requests? >> I assume that's how it should work with DROP channel. >> >> Best regards, >> Michal Wegrzyn >> >> > -----Original Message----- >> > From: Martin Grigorov [mailto:[email protected]] >> > Sent: Thursday, November 03, 2011 17:54 >> > To: [email protected] >> > Subject: Re: abort loading lazy components >> > >> > Here is something that I didn't know so far: >> > http://stackoverflow.com/questions/930237/javascript-cancel-stop- >> image- >> > requests/1468452#1468452 >> > >> > It seems there is a way to simulate browser's stop button with >> > JavaScript. >> > Try to use that code from IAjaxCallDecorator#decorateScript() for >> your >> > AjaxLink. >> > >> > On Thu, Nov 3, 2011 at 3:00 PM, Michal Wegrzyn >> > <[email protected]> wrote: >> > > I've just debugged and indeed problem is that there is no component >> > with id "29". >> > > So clearly Wicket looks for an lazy "children" component from >> > outdated DataView component. >> > > >> > > Michal >> > > >> > >> -----Original Message----- >> > >> From: Michal Wegrzyn [mailto:[email protected]] >> > >> Sent: Wednesday, November 02, 2011 16:11 >> > >> To: [email protected] >> > >> Subject: RE: abort loading lazy components >> > >> >> > >> It is triggered when there is already new "itemList" (it extends >> > >> DataView), so I suppose that >> > >> PageAndComponentProvider looks for "itemList:29", which does not >> > exists >> > >> anymore. >> > >> >> > >> Scenario: >> > >> >> > >> - Page is loaded but lazy components >> > >> ('folders:listContainer:itemList:itemPanel:folder:children') are >> > still >> > >> loading >> > >> - User triggers folder change (itemList is replaced) >> > >> - Exception occurs >> > >> >> > >> If user triggers folder change when lazy components are completely >> > >> loaded (or during loading the last one) there is no exception at >> > all. >> > >> >> > >> Best Regards, >> > >> Michal Wegrzyn >> > >> >> > >> -----Original Message----- >> > >> From: Martin Grigorov [mailto:[email protected]] >> > >> Sent: Wednesday, November 02, 2011 15:54 >> > >> To: [email protected] >> > >> Subject: Re: abort loading lazy components >> > >> >> > >> On Wed, Nov 2, 2011 at 4:49 PM, Michal Wegrzyn >> > >> <[email protected]> wrote: >> > >> > 15:32:24.028 user [http-8888-5] ERROR >> > >> o.a.wicket.DefaultExceptionMapper - Unexpected error occurred >> > >> > org.apache.wicket.request.handler.ComponentNotFoundException: >> > Could >> > >> not find component >> > >> 'folders:listContainer:itemList:29:itemPanel:folder:children' on >> > page >> > >> 'class package.MyPage >> > >> >> > >> Do you know how this is triggered ? >> > > >> > > >> > >> > >> > >> > -- >> > Martin Grigorov >> > jWeekend >> > Training, Consulting, Development >> > http://jWeekend.com >> > >> > --------------------------------------------------------------------- >> > To unsubscribe, e-mail: [email protected] >> > For additional commands, e-mail: [email protected] > > -- Martin Grigorov jWeekend Training, Consulting, Development http://jWeekend.com --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
