wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Geery <andrew.ge...@gmail.com>
Subject Re: AjaxLazyLoadPanel
Date Tue, 21 Apr 2015 03:24:37 GMT
In AjaxLazyLoadPanel#getLazyComponent(String), you should be using the id
parameter, not "pList", when creating the PListPanel.

Andrew

@Override
public Component getLazyLoadComponent(String id) {
                        return new PListPanel("pList", pModel); // change
the first param from "pList" to id
        }

On Mon, Apr 20, 2015 at 11:10 PM, Chris <chris.gr@gmx.at> wrote:

> Hi all,
>
> I am following the example from
> http://www.mkyong.com/wicket/how-do-use-ajaxlazyloadpanel-in-wicket/ but
> get following error:
>
> Last cause: Cannot replace a component which has not been added:
> id='pList', component=[PListPanel [Component id = pList]]:
> [AjaxLazyLoadPanel [Component id = pList]]
>
> By the way, is the checking for JavaEnabled valid or still needed? I have
> JavaScript enabled but the method #isJavaEnabled returns false;
>
> WebClientInfo clientInfo = WebSession.get().getClientInfo();
> if (clientInfo.getProperties().isJavaEnabled()) {
>         add(new AjaxLazyLoadPanel("pList", pModel) {
>                 @Override
>                 public Component getLazyLoadComponent(String id) {
>                         return new PListPanel("pList", pModel);
>         }
>     }).setOutputMarkupId(true);
> } else {
>         add(new PListPanel("pList", pModel);
> }
>
> Thanks, Chris

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message