2 Replies Latest reply on Apr 13, 2009 2:58 PM by tw

    extendedDataTable sorting and grouping not working with dyna

    tw

      RF 3.3.0 GA

      Created table with dynamic columns. Data displays fine, but neither sorting nor grouping works. Sort does not have any effect. Grouping by dynamic column produces NPE

      java.lang.NullPointerException
      at org.richfaces.component.UIExtendedDataTable.getGroupPriority(UIExtendedDataTable.java:265)
      at org.richfaces.component.UIExtendedDataTable.createDataModel(UIExtendedDataTable.java:310)
      at org.ajax4jsf.component.UIDataAdaptor.getExtendedDataModel(UIDataAdaptor.java:621)

      It turns out the the column to group by is not found, the id does not match any of the ids present in the data table model.

      Sorting and grouping works fine with rich:column tag, but I need dynamic columns.

      Is this a known issue? Any fix/workaround?


      
       <rich:extendedDataTable id="edtTestTable"
       value="#{EdtTestBean.rowIds}"
       var="rowId"
       selectionMode="multi"
       selection="#{EdtTestBean.selection}"
       selectedClass="selected"
       rowClasses="tablerow1,tablerow2"
       columnsWidth="0*"
       width="100%"
       height="308px">
      
       <rich:columns value="#{EdtTestBean.getColumns()}" var="col" index="colIndex" label="#{col.description}" begin="2" end="3"
       sortable="true" sortBy="#{EdtTestBean.getRow(rowId)[colIndex].value}"
       sortIconAscending="dataTableAscIcon"
       sortIconDescending="dataTableDescIcon">
       <f:facet name="header">
       <h:outputText value="#{col.description}" />
       </f:facet>
       <h:outputText value="#{EdtTestBean.getRow(rowId)[colIndex].value}" />
       </rich:columns>
      
      
       </rich:extendedDataTable>