1 Reply Latest reply on Nov 7, 2008 3:42 AM by Kloot Perwee

    Datable sorting problem

    Kloot Perwee Newbie

      First off: I am using Spring Web Flow underneath Richfaces!

      I am using the rich:dataTable tag in conjunction with a checkbox (with a4j:support) on every row. Now if I first render the rich:dataTable with a Collection of beans like so:

      <rich:dataTable id="listTable"
       <f:facet name="header">
       <h:outputText value="#{flowScope.title}" />
       <rich:column id="CbbNr" sortBy="#{listElement.cbbNummer}" rendered="#{flowScope.listtype != 'A'}">
       <f:facet name="header">
       <rich:column id="columnA" rendered="#{flowScope.listtype == 'A' and flowScope.personal == false}" style="text-align:center;">
       <f:facet #{resourceBundle['message.list.column.A']}
       <h:selectBooleanCheckbox value="#{listElement.claimAsManager}" rendered="#{listElement.manager == null}">
       <a4j:support event="onchange" reRender="listTable" ajaxSingle="true" />

      I can check all the rows I want to "claimAsManager" and if I save the page the correct rows (or ListDTOs) get updated.
      Now if I sort the table with the sortBy="#{listElement.cbbNummer}" column and I claim some other rows I effectively claim other rows then suspected, in fact I claim those rows at the positions they first appeared in the first rendition (before the sort).
      I checked the id's of the rows and it turns out that every row keeps it's id before and after the sorting.
      Has anyone experienced the same problem with sorting the dataTable? Is this a bug or am I forgetting something?

        • 1. Re: Datable sorting problem
          Kloot Perwee Newbie

          Ok, the problem resided in the use of ajaxSingle="true" in the h:selectBooleanCheckbox of a row.
          It was due to the fact that while changing the checkbox only the checkbox is send to the server and not the (sorting) information of the table i.e. which column is sorted ASC or DESC.