4 Replies Latest reply on Aug 24, 2011 6:58 AM by Walid KRIFI

    Extended DataTable issue?

    Walid KRIFI Newbie

      Hi All,

      I have an extended data table with parametrised rendering for each column something like this :

       

       

                  <rich:column rendered="#{reconSettings.param}">
                   <f:facet name="header">
                     <h:outputText value="Col1" />
      
                  <a4j:commandLink action="#{reconSettings.removeColumns}" render="table">
                          <a4j:param value="5" assignTo="#{reconSettings.columnId}" />
                  </a4j:commandLink> 
      
                        </f:facet>
                                  <h:outputText value="#{reconItem.value}" />                
                  </rich:column>
      
      

       

      When i move this colum everyting is ok but when after i click  on the command link i have this exception :

       

      31 juil. 2011 21:22:09 org.richfaces.context.ExtendedPartialViewContextImpl$RenderVisitCallback logException
      GRAVE: null
      java.lang.NullPointerException
                at org.richfaces.renderkit.ExtendedDataTableRenderer.encodeHeaderOrFooterCell(ExtendedDataTableRenderer.java:252)
                at org.richfaces.renderkit.ExtendedDataTableRenderer.encodeHeaderOrFooter(ExtendedDataTableRenderer.java:340)
                at org.richfaces.renderkit.ExtendedDataTableRenderer.encodeHeader(ExtendedDataTableRenderer.java:384)
                at org.richfaces.renderkit.ExtendedDataTableRenderer.doEncodeChildren(ExtendedDataTableRenderer.java:641)
                at org.richfaces.renderkit.RendererBase.encodeChildren(RendererBase.java:157)
                at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:853)
                at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1652)
                at javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
                at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:853)
                at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1652)
                at org.richfaces.context.ExtendedPartialViewContextImpl$RenderVisitCallback.visit(ExtendedPartialViewContextImpl.java:514)
                at org.richfaces.context.BaseExtendedVisitContext.invokeVisitCallback(BaseExtendedVisitContext.java:337)
                at javax.faces.component.UIForm.visitTree(UIForm.java:345)
                at javax.faces.component.UIComponent.visitTree(UIComponent.java:1496)
                at javax.faces.component.UIComponent.visitTree(UIComponent.java:1496)
                at org.richfaces.context.ExtendedPartialViewContextImpl.processPartialRenderPhase(ExtendedPartialViewContextImpl.java:284)
                at org.richfaces.context.ExtendedPartialViewContextImpl.processPartial(ExtendedPartialViewContextImpl.java:206)
                at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:974)
                at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1652)
                at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:388)
                at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
                at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273)
                at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:121)
                at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
                at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
                at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
                at integridata.jcaars.ui.common.CompatibilityFilter.doFilter(CompatibilityFilter.java:59)
                at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:242)
                at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
                at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
                at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:203)
                at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
                at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:108)
                at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:558)
                at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
                at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:379)
                at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:242)
                at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:259)
                at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:281)
                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
                at java.lang.Thread.run(Thread.java:662)
      
      

       

       

      Any idea?

        • 1. Re: Extended DataTable issue?
          Nick Belaevski Master

          Hi,

           

          Can you please post the code you use for removing columns?

          • 2. Re: Extended DataTable issue?
            Walid KRIFI Newbie

            Hi,

            The column is managed by a property in a settings bean (here named reconSettings.param) so when I click in the commandLink(with action reconSettings.removeColumns)  I turn the property in the settings bean to false and the column is not shown.

             

                        <rich:column rendered="#{reconSettings.param}">
                         <f:facet name="header">
                           <h:outputText value="Col1" />

                        <a4j:commandLink action="#{reconSettings.removeColumns}" render="table">
                                <a4j:param value="5" assignTo="#{reconSettings.columnId}" />
                        </a4j:commandLink>

                              </f:facet>
                                        <h:outputText value="#{reconItem.value}" />               
                        </rich:column>

            • 3. Re: Extended DataTable issue?
              Walid KRIFI Newbie

              Any idea??

              • 4. Re: Extended DataTable issue?
                Walid KRIFI Newbie

                I did a patch for ExtendedDataTableRender. When we have to test if column is rendered or not we have to test if column is not null and it fix my problem now I can move and remove column without error.