I come across a very puzzling behavior in wicket-1.2.2. I add a component to its container when the page is initialized, BEFORE it is rendered and before page model finished to initialize. if log4j is configured to enable wicket debug, the container toString() is called. This method invoked isVisible() of the container. I have overriden isVisible(), to query the page model before deciding whether the component is actually visible. I assumed this method is called when the component is rendered, and by that time the model is completely initialized. However, since it was called before component rendering, my code failed and the page failed to be created. My question is: 1. Why isn't toString() of Component a safe method ? 2. Why does it call isVisible before page is rendered? Thanks Nili
java.lang.NullPointerException at com.qlusters.qrm.plugins.provision.web.ProvisionWebUtils.isVeDeleted(ProvisionWebUtils.java:374) at com.qlusters.qrm.plugins.provision.web.ProvisioningRequestSummaryForm$15.isVisible(ProvisioningRequestSummaryForm.java:405) at wicket.Component.toString(Component.java:2176) at wicket.MarkupContainer.toString(MarkupContainer.java:685) at wicket.MarkupContainer.toString(MarkupContainer.java:673) at java.lang.String.valueOf(String.java:2615) at java.lang.StringBuffer.append(StringBuffer.java:220) at wicket.MarkupContainer.add(MarkupContainer.java:149) at com.qlusters.qrm.plugins.provision.web.ProvisioningRequestSummaryForm.addChangeIndication(ProvisioningRequestSummaryForm.java:453) at com.qlusters.qrm.plugins.provision.web.ProvisioningRequestSummaryForm.init(ProvisioningRequestSummaryForm.java:47) at com.qlusters.qrm.plugins.provision.web.ProvisioningRequestSummary.doView(ProvisioningRequestSummary.java:50) at com.qlusters.qrm.web.wicket.WebPageFactory.decorate(WebPageFactory.java:84) at com.qlusters.qrm.web.wicket.WebPageFactory.newPage(WebPageFactory.java:53) at wicket.request.target.component.BookmarkablePageRequestTarget.newPage(BookmarkablePageRequestTarget.java:271) at wicket.request.target.component.BookmarkablePageRequestTarget.getPage(BookmarkablePageRequestTarget.java:286) at wicket.request.target.component.BookmarkablePageRequestTarget.processEvents(BookmarkablePageRequestTarget.java:205) at wicket.request.compound.DefaultEventProcessorStrategy.processEvents(DefaultEventProcessorStrategy.java:65) at wicket.request.compound.AbstractCompoundRequestCycleProcessor.processEvents(AbstractCompoundRequestCycleProcessor.java:57) at wicket.RequestCycle.doProcessEventsAndRespond(RequestCycle.java:852) at wicket.RequestCycle.processEventsAndRespond(RequestCycle.java:885) at wicket.RequestCycle.step(RequestCycle.java:966) at wicket.RequestCycle.steps(RequestCycle.java:1040) at wicket.RequestCycle.request(RequestCycle.java:454) at wicket.protocol.http.WicketServlet.doGet(WicketServlet.java:216) at javax.servlet.http.HttpServlet.service(HttpServlet.java:690) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at com.qlusters.qrm.server.api.objects.transactions.TransactionFilter.doFilter(TransactionFilter.java:135) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685) at java.lang.Thread.run(Thread.java:595) ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user