Multiple AjaxLazyLoadPanel in the same page Wicket 8

330 views Asked by At

Is it possible to lazy load each item of a RepeatingView in Wicket 8 with AjaxLazyLoadPanel? Back in wicket 7, using AjaxLazyLoadPanel, each item in the RepeatingView was loaded independently.

The AjaxLazyLoadPanel behavior has changed in wicket 8 "When you have multiple AjaxLazyLoadPanels on the same page, only one timer is used and all panels piggyback on this single timer."

With this change all items need to be loaded before being rendered. Is there a way to get around this in wicket 8?

1

There are 1 answers

0
svenmeier On

Your AjaxLazyLoadPanels should override isContentReady:

protected boolean isContentReady()
{
    return ...; // check whether result can be rendered
}

This way the page isn't blocked while the data can be loaded asynchronously.

Please see the example https://github.com/apache/wicket/blob/master/wicket-examples/src/main/java/org/apache/wicket/examples/ajax/builtin/LazyLoadingPage.java