you shouldnt have requests that take a long time to process. there are
lots of problems with this like users starving your threadpool, etc.

instead you should load the data in another thread and either use a
push notification or let the client poll to find out if the data is
available.

unfortunately the ajaxlazyloadpanel is not implemented correctly, it
doesnt poll but simply request and wait for the data with ajax.

a better implementation might look like this and might better work for
what you need:

class BetterLazyLoadPanel extends Panel {
   public BetterLazyLoadPanel() {
       add(new WebMarkupContainer("content")); <-- placeholder until
the right component is added
       add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(2)) {
          onTimer(target) {
             Component replacement=getLazyLoadedComponent("content");
             if (replacement!=null) {
                replace(replacement);
                stop();
                target.add(BetterLazyLoadPanel.this);
             }
          }
       });
   }

   protected abstract getLazyLoadedComponent(String id);
}

now in getLazyLoadedComponent() you can return null until your data
has finished loading in another thread, and when its done return the
component you wish to represent it with. hope this helps.

-igor


On Sun, Oct 23, 2011 at 9:06 AM, YaronHolland <gel...@yahoo.com> wrote:
> We have some pages that might take a long time to load, depanding on data.
>
> Once the user has clicked a link to another page (Or switched a tab if it is
> a tabed page), is there a way to terminate the request to prevent a load on
> the server for a page that will not be displayed?
>
> In a tabed page, is there a way to go to another tab without waiting for the
> first tab to rendered? (As the tab link is waiting to the page map to be
> relased...)
>
> --
> View this message in context: 
> http://apache-wicket.1842946.n4.nabble.com/PageMap-locking-tp3930623p3930623.html
> Sent from the Users forum mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

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

Reply via email to