5 Replies Latest reply on Oct 31, 2009 11:23 AM by Nick Belaevski

    <rich:componentControl> causes NullPointerException in Exten

    Tobias Keller Newbie

      Hi

      on my page I have the problem that <rich:componentControl> causes a NullPointerException (see stacktrace below) in ExtendedTableDataModel.getRowIndex().
      The page contains two <rich:extendedDataTable>, one in the page and one in the <rich:modalPanel>.
      The NullPointerException occurs in the page <rich:extendedDataTable>.

      When I delete <rich:componentControl>, the ExtendedTableDataModel.getRowIndex() is not called.

      Why does <rich:componentControl> call getRowIndex()?


      Best regards
      Tobi

      <a4j:commandButton id="searchModal" value="..." action="#{verkaufteRueckloseBean.doLeNrModal}" reRender="leNrModPanelTable">
       <!-- Causes ExtendedTableDataModel.getRowIndex(ExtendedTableDataModel.java:206) call -->
       <rich:componentControl id="searchModalControl" for="searchModalPanel" attachTo="searchModal"
       operation="show" event="onclick" />
      
      </a4j:commandButton>
      
      ...
      
       <rich:modalPanel id="searchModalPanel" width="500" autosized="true">
       <rich:extendedDataTable>
      ...
      
      
      javax.faces.FacesException: Exception while calling encodeEnd on component : {Component-Path : [Class: org.ajax4jsf.component.AjaxViewRoot,ViewId: /uiprototyp/testpage.xhtml][Class: javax.faces.component.html.HtmlForm,Id: formMain][Class: org.richfaces.component.html.HtmlPanel,Id: dialogPanel][Class: org.richfaces.component.html.HtmlPanel,Id: mainPanel][Class: javax.faces.component.html.HtmlPanelGroup,Id: j_id107]}
       at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:627)
       at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:281)
       at org.ajax4jsf.renderkit.RendererBase.renderChildren(RendererBase.java:258)
       at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:220)
       at org.richfaces.renderkit.html.PanelRenderer.doEncodeChildren(PanelRenderer.java:215)
       at org.ajax4jsf.renderkit.RendererBase.encodeChildren(RendererBase.java:120)
       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:611)
       at org.ajax4jsf.renderkit.RendererBase.renderChild(RendererBase.java:277)
       at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:166)
       at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:83)
       at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:157)
       at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:83)
       at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:157)
       at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:83)
       at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:157)
       at org.ajax4jsf.renderkit.AjaxContainerRenderer.encodeAjax(AjaxContainerRenderer.java:123)
       at org.ajax4jsf.component.AjaxViewRoot.encodeAjax(AjaxViewRoot.java:677)
       at org.ajax4jsf.component.AjaxViewRoot.encodeChildren(AjaxViewRoot.java:548)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:250)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:592)
       at org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:100)
       at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:176)
       at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:155)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:619)
      Caused by: javax.faces.FacesException: Exception while calling encodeEnd on component : {Component-Path : [Class: org.ajax4jsf.component.AjaxViewRoot,ViewId: /uiprototyp/testpage.xhtml][Class: javax.faces.component.html.HtmlForm,Id: formMain][Class: org.richfaces.component.html.HtmlPanel,Id: dialogPanel][Class: org.richfaces.component.html.HtmlPanel,Id: mainPanel][Class: javax.faces.component.html.HtmlPanelGroup,Id: j_id107][Class: org.ajax4jsf.component.html.HtmlAjaxCommandButton,Id: searchModal][Class: org.richfaces.component.html.HtmlComponentControl,Id: searchModalControl]}
       at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:627)
       at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:534)
       at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChildren(RendererUtils.java:511)
       at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChild(RendererUtils.java:532)
       at org.apache.myfaces.shared_impl.renderkit.RendererUtils.renderChildren(RendererUtils.java:511)
       at org.apache.myfaces.shared_impl.renderkit.html.HtmlGroupRendererBase.encodeEnd(HtmlGroupRendererBase.java:92)
       at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:624)
       ... 63 more
      Caused by: java.lang.NullPointerException
       at org.richfaces.model.ExtendedTableDataModel.getRowIndex(ExtendedTableDataModel.java:206)
       at org.ajax4jsf.component.UIDataAdaptor.getRowIndex(UIDataAdaptor.java:311)
       at javax.faces.component._ComponentUtils.idsAreEqual(_ComponentUtils.java:134)
       at javax.faces.component._ComponentUtils.findComponent(_ComponentUtils.java:110)
       at javax.faces.component._ComponentUtils.findComponent(_ComponentUtils.java:107)
       at javax.faces.component._ComponentUtils.findComponent(_ComponentUtils.java:107)
       at javax.faces.component.UIComponentBase.findComponent(UIComponentBase.java:449)
       at org.ajax4jsf.renderkit.RendererUtils.findComponentFor(RendererUtils.java:877)
       at org.ajax4jsf.renderkit.RendererUtils.findComponentFor(RendererUtils.java:854)
       at org.richfaces.component.util.HtmlUtil.expandIdSelector(HtmlUtil.java:75)
       at org.richfaces.renderkit.ComponentControlRendererBase.replaceClientIds(ComponentControlRendererBase.java:88)
       at org.richfaces.renderkit.html.ComponentControlRenderer.doEncodeEnd(ComponentControlRenderer.java:167)
       at org.richfaces.renderkit.html.ComponentControlRenderer.doEncodeEnd(ComponentControlRenderer.java:193)
       at org.ajax4jsf.renderkit.RendererBase.encodeEnd(RendererBase.java:134)
       at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:624)
       ... 69 more