Java != JavaScript If BrowserInfoPage has set the ClientInfo properties then JavaScript is enabled
Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Tue, Apr 21, 2015 at 2:09 PM, Chris <[email protected]> wrote: > Andrew, thanks a lot! > > How could I in addition check if Javascript is enabled so that I can add a > default Panel in case if it is not enabled? > > The following 2 lines do not work as it returns false although JS is > enabled. > > WebClientInfo clientInfo = WebSession.get().getClientInfo(); > if (clientInfo.getProperties().isJavaEnabled()) … > > br, Chris > > > Am 21.04.2015 um 05:24 schrieb Andrew Geery <[email protected]>: > > > > 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 <[email protected]> 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 > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
