It seems that this is what I was looking for.

Unfortunately I get ComponentNotFoundException already 
during handling my new ajax request. It seems that 
request handler tries to render component which does not 
exist anymore (from page's previous state):

org.apache.wicket.request.handler.ComponentNotFoundException: Could not find 
component 
'path:to:my:lazy:component' on page 'class package.MyPage'
     at 
org.apache.wicket.request.handler.PageAndComponentProvider.getComponent(PageAndComponentProvider.java:167)
     at 
org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.getComponent(ListenerInterfaceRequestHandler.java:81)
     at 
org.apache.wicket.request.handler.ListenerInterfaceRequestHandler.respond(ListenerInterfaceRequestHandler.java:150)
     at 
org.apache.wicket.request.cycle.RequestCycle$HandlerExecutor.respond(RequestCycle.java:712)
     at 
org.apache.wicket.request.RequestHandlerStack.execute(RequestHandlerStack.java:63)
     at 
org.apache.wicket.request.cycle.RequestCycle.processRequest(RequestCycle.java:208)
     at 
org.apache.wicket.request.cycle.RequestCycle.processRequestAndDetach(RequestCycle.java:251)
     at 
org.apache.wicket.protocol.http.WicketFilter.processRequest(WicketFilter.java:162)
     at 
org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:218) 

Best regards,
Michal Wegrzyn

-----Original Message-----
From: Martin Grigorov [mailto:mgrigo...@apache.org] 
Sent: Tuesday, November 01, 2011 12:09
To: users@wicket.apache.org
Subject: Re: abort loading lazy components

See org.apache.wicket.ajax.AjaxChannel.Type.DROP
You'll have to override AjaxLink#getChannel() to return DROP if you
want clicking on this AjaxLink to remove all scheduled ajax calls at
the client side.
But even with this improvement you'll still have to wait for the
currently being executed Ajax call (the first lazy loading component).

On Tue, Nov 1, 2011 at 1:03 PM, Michal Wegrzyn <michal.wegr...@onior.com> wrote:
> Thanks for reply Martin.
>
> Using BookmarkablePageLink indeed cancels other lazy ajax requests,
> but then page is created from the scratch (as BookmarkablePageLink
> extends normal Link).
>
> At the moment only AjaxLinks are used (so they create just another ajax
> requests that are queued after ajax lazy requests) and one page, so
> I would like to do it without reloading whole page.
>
> Best regards,
> Michal Wegrzyn
>
> -----Original Message-----
> From: Martin Grigorov [mailto:mgrigo...@apache.org]
> Sent: Tuesday, November 01, 2011 11:05
> To: users@wicket.apache.org
> Subject: Re: abort loading lazy components
>
> On Tue, Nov 1, 2011 at 10:36 AM, Michal Wegrzyn
> <michal.wegr...@onior.com> wrote:
>> Hello,
>>
>> In application which I am developing AjaxLazyLoadPanel is used for several 
>> components.
>> Wicket creates queue of synchronous Ajax requests for every lazy component.
>>
>> I saw several discussions about the way how Wicket loads the components
>> (and AFAIK Wicket can do it only synchronously), but I could not find 
>> anything about
>> canceling these requests.
>>
>> Now, even if user triggers new request, he still has to wait to load all 
>> lazy components.
>> Then Wicket continues with request which was triggered during loading lazy 
>> components.
>
> Even when the new request is issued by BookmarkablePageLink ?
>
> I can see how requests to the same page instance are queued but
> request to new page should be possible.
>
>>
>> Is there any way to cancel loading of the lazy components and handle new 
>> request immediately?
>>
>> Yours sincerely,
>>
>> Michal Wegrzyn
>>
>
>
>
> --
> Martin Grigorov
> jWeekend
> Training, Consulting, Development
> http://jWeekend.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

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

Reply via email to