ICEfaces
  1. ICEfaces
  2. ICE-7329

ace:dataTable - sorting not working for table using column grouping

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1-Beta
    • Fix Version/s: 2.1-Beta2, 3.0
    • Component/s: ACE-Components
    • Labels:
      None
    • Environment:
      ICEfaces 2.1.0 BETA 10072011

      Description

      Sorting is no longer working for a dataTable using column header grouping. The icons render and can be clicked but the data is not sorted accordingly. When using non-column grouping (as is in the comps-suite) sorting works fine. This seems to be a regression on the latest release.

        Issue Links

          Activity

          Hide
          Nils Lundquist added a comment -

          I wouldn't have thought this would work in the first place. Sorting + grouped headers was a incompatibility captured in ICE-7028.

          Show
          Nils Lundquist added a comment - I wouldn't have thought this would work in the first place. Sorting + grouped headers was a incompatibility captured in ICE-7028 .
          Hide
          Arran Mccullough added a comment -

          The sorting was working on the Oct 2nd release. One of the fixes since then seemed to have broken this.

          Show
          Arran Mccullough added a comment - The sorting was working on the Oct 2nd release. One of the fixes since then seemed to have broken this.
          Hide
          Mark Collette added a comment -

          In Firebug, we can see the sorting causes a POST, and this is the response. Evidently, JSF has encountered an error, and then has had an error while trying to report the first one.

          <html><head><title>Apache Tomcat/7.0.20 - Error report</title><style><!--H1

          {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}

          H2

          {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}

          H3

          {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}

          BODY

          {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;}

          B

          {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}

          P

          {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}

          A

          {color : black;}

          A.name

          {color : black;}

          HR

          {color : #525D76;}

          --></style> </head><body><h1>HTTP Status 500 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server encountered an internal error () that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>java.lang.IllegalStateException: CDATA tags may not nest
          com.sun.faces.renderkit.html_basic.HtmlResponseWriter.startCDATA(HtmlResponseWriter.java:630)
          javax.faces.context.ResponseWriterWrapper.startCDATA(ResponseWriterWrapper.java:172)
          javax.faces.context.PartialResponseWriter.startError(PartialResponseWriter.java:342)
          org.icefaces.ace.context.CallbackPartialResponseWriter.startError(CallbackPartialResponseWriter.java:120)
          com.sun.faces.context.AjaxExceptionHandlerImpl.handlePartialResponseError(AjaxExceptionHandlerImpl.java:200)
          com.sun.faces.context.AjaxExceptionHandlerImpl.handle(AjaxExceptionHandlerImpl.java:123)
          org.icefaces.impl.application.ExtendedExceptionHandler.handle(ExtendedExceptionHandler.java:109)
          com.sun.faces.lifecycle.Phase.doPhase(Phase.java:119)
          com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
          javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
          </pre></p><p><b>note</b> <u>The full stack trace of the root cause is available in the Apache Tomcat/7.0.20 logs.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.20</h3></body></html>

          Show
          Mark Collette added a comment - In Firebug, we can see the sorting causes a POST, and this is the response. Evidently, JSF has encountered an error, and then has had an error while trying to report the first one. <html><head><title>Apache Tomcat/7.0.20 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;} A {color : black;} A.name {color : black;} HR {color : #525D76;} --></style> </head><body><h1>HTTP Status 500 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>The server encountered an internal error () that prevented it from fulfilling this request.</u></p><p><b>exception</b> <pre>java.lang.IllegalStateException: CDATA tags may not nest com.sun.faces.renderkit.html_basic.HtmlResponseWriter.startCDATA(HtmlResponseWriter.java:630) javax.faces.context.ResponseWriterWrapper.startCDATA(ResponseWriterWrapper.java:172) javax.faces.context.PartialResponseWriter.startError(PartialResponseWriter.java:342) org.icefaces.ace.context.CallbackPartialResponseWriter.startError(CallbackPartialResponseWriter.java:120) com.sun.faces.context.AjaxExceptionHandlerImpl.handlePartialResponseError(AjaxExceptionHandlerImpl.java:200) com.sun.faces.context.AjaxExceptionHandlerImpl.handle(AjaxExceptionHandlerImpl.java:123) org.icefaces.impl.application.ExtendedExceptionHandler.handle(ExtendedExceptionHandler.java:109) com.sun.faces.lifecycle.Phase.doPhase(Phase.java:119) com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139) javax.faces.webapp.FacesServlet.service(FacesServlet.java:594) </pre></p><p><b>note</b> <u>The full stack trace of the root cause is available in the Apache Tomcat/7.0.20 logs.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.20</h3></body></html>
          Hide
          Mark Collette added a comment -

          From the server log we can see that ColumnBase is trying to state save a Map, which has a null value in it, that's causing the exception. Since column has no Map properties, and the stack trace isn't showing much saveState recursion, it's likely that it's the StateHelper's own Map that has the null entry.

          java.lang.NullPointerException
          at javax.faces.component.StateHolderSaver.<init>(StateHolderSaver.java:96)
          at javax.faces.component.UIComponentBase.saveAttachedState(UIComponentBase.java:1695)
          at javax.faces.component.ComponentStateHelper.saveMap(ComponentStateHelper.java:378)
          at javax.faces.component.ComponentStateHelper.saveState(ComponentStateHelper.java:256)
          at javax.faces.component.UIComponentBase.saveState(UIComponentBase.java:1501)
          at org.icefaces.ace.component.column.ColumnBase.saveState(ColumnBase.java:1324)
          at com.sun.faces.application.view.StateManagementStrategyImpl$1.visit(StateManagementStrategyImpl.java:168)
          at com.sun.faces.component.visit.FullVisitContext.invokeVisitCallback(FullVisitContext.java:151)
          at org.icefaces.ace.component.datatable.DataTable.visitColumnsAndColumnFacets(DataTable.java:502)
          at org.icefaces.ace.component.datatable.DataTable.visitTree(DataTable.java:466)
          at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
          at javax.faces.component.UIForm.visitTree(UIForm.java:344)
          at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
          at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600)
          at com.sun.faces.application.view.StateManagementStrategyImpl.saveView(StateManagementStrategyImpl.java:160)
          at com.sun.faces.application.StateManagerImpl.saveView(StateManagerImpl.java:133)
          at javax.faces.application.StateManager.getViewState(StateManager.java:553)
          at org.icefaces.impl.context.DOMPartialViewContext.renderState(DOMPartialViewContext.java:448)
          at org.icefaces.impl.context.DOMPartialViewContext.processPartial(DOMPartialViewContext.java:205)
          at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:981)
          at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1756)
          at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:390)
          at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
          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:594)

          Show
          Mark Collette added a comment - From the server log we can see that ColumnBase is trying to state save a Map, which has a null value in it, that's causing the exception. Since column has no Map properties, and the stack trace isn't showing much saveState recursion, it's likely that it's the StateHelper's own Map that has the null entry. java.lang.NullPointerException at javax.faces.component.StateHolderSaver.<init>(StateHolderSaver.java:96) at javax.faces.component.UIComponentBase.saveAttachedState(UIComponentBase.java:1695) at javax.faces.component.ComponentStateHelper.saveMap(ComponentStateHelper.java:378) at javax.faces.component.ComponentStateHelper.saveState(ComponentStateHelper.java:256) at javax.faces.component.UIComponentBase.saveState(UIComponentBase.java:1501) at org.icefaces.ace.component.column.ColumnBase.saveState(ColumnBase.java:1324) at com.sun.faces.application.view.StateManagementStrategyImpl$1.visit(StateManagementStrategyImpl.java:168) at com.sun.faces.component.visit.FullVisitContext.invokeVisitCallback(FullVisitContext.java:151) at org.icefaces.ace.component.datatable.DataTable.visitColumnsAndColumnFacets(DataTable.java:502) at org.icefaces.ace.component.datatable.DataTable.visitTree(DataTable.java:466) at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600) at javax.faces.component.UIForm.visitTree(UIForm.java:344) at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600) at javax.faces.component.UIComponent.visitTree(UIComponent.java:1600) at com.sun.faces.application.view.StateManagementStrategyImpl.saveView(StateManagementStrategyImpl.java:160) at com.sun.faces.application.StateManagerImpl.saveView(StateManagerImpl.java:133) at javax.faces.application.StateManager.getViewState(StateManager.java:553) at org.icefaces.impl.context.DOMPartialViewContext.renderState(DOMPartialViewContext.java:448) at org.icefaces.impl.context.DOMPartialViewContext.processPartial(DOMPartialViewContext.java:205) at javax.faces.component.UIViewRoot.encodeChildren(UIViewRoot.java:981) at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1756) at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:390) at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131) 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:594)
          Hide
          Mark Collette added a comment -

          Once the generated setter methods are fixed, the state saving exception will go away, and we can further examine the dataTable component to fix the issue.

          Show
          Mark Collette added a comment - Once the generated setter methods are fixed, the state saving exception will go away, and we can further examine the dataTable component to fix the issue.
          Hide
          Mark Collette added a comment -

          This turned out to be unrelated, but all the app bean classes needed to be made Serializable, since I was also getting this error in the log:
          WARNING: JSF1063: WARNING! Setting non-serializable attribute value into HttpSession (key: testBean, value class: com.icefaces.support.example.TestBean).

          Show
          Mark Collette added a comment - This turned out to be unrelated, but all the app bean classes needed to be made Serializable, since I was also getting this error in the log: WARNING: JSF1063: WARNING! Setting non-serializable attribute value into HttpSession (key: testBean, value class: com.icefaces.support.example.TestBean).
          Hide
          Mark Collette added a comment -

          There was an omission in some of the DataTable sorting code to handle the header columnGroup scenario. The renderer was changed because I added debug to diagnose the situation, that I subsequently removed, but in the mean while, made the code follow our coding standards. The DOMPartialViewContext change was to augment some of the logging there.

          Internal development repository
          Subversion 25916
          ace/component/src/org/icefaces/ace/component/datatable/DataTable.java
          ace/component/src/org/icefaces/ace/component/datatable/DataTableRenderer.java
          core/src/main/java/org/icefaces/impl/context/DOMPartialViewContext.java

          Show
          Mark Collette added a comment - There was an omission in some of the DataTable sorting code to handle the header columnGroup scenario. The renderer was changed because I added debug to diagnose the situation, that I subsequently removed, but in the mean while, made the code follow our coding standards. The DOMPartialViewContext change was to augment some of the logging there. Internal development repository Subversion 25916 ace/component/src/org/icefaces/ace/component/datatable/DataTable.java ace/component/src/org/icefaces/ace/component/datatable/DataTableRenderer.java core/src/main/java/org/icefaces/impl/context/DOMPartialViewContext.java
          Hide
          Brad Kroeger added a comment -

          Tested with bundle today in Williams application, multi column sorting is not working properly , for instance sort one column, go to ctrl-click a second column and it toggles the first column order, doesn't seem to sort the second column order as specified (the opposite order).

          I suggest sorting be added to the poc and tested there.

          Show
          Brad Kroeger added a comment - Tested with bundle today in Williams application, multi column sorting is not working properly , for instance sort one column, go to ctrl-click a second column and it toggles the first column order, doesn't seem to sort the second column order as specified (the opposite order). I suggest sorting be added to the poc and tested there.
          Hide
          Ken Fyten added a comment -

          Resolving until someone can document a way to reproduce the actual issue.

          Show
          Ken Fyten added a comment - Resolving until someone can document a way to reproduce the actual issue.

            People

            • Assignee:
              Nils Lundquist
              Reporter:
              Arran Mccullough
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: