[richfaces-issues] [JBoss JIRA] Created: (RF-2148) Selection after sorting a column in scrollableDataTable

Claus Nyhus (JIRA) jira-events at lists.jboss.org
Sat Feb 2 05:07:29 EST 2008


Selection after sorting a column in scrollableDataTable
-------------------------------------------------------

                 Key: RF-2148
                 URL: http://jira.jboss.com/jira/browse/RF-2148
             Project: RichFaces
          Issue Type: Bug
    Affects Versions: 3.1.4
         Environment: OS X, FF2.0.0.11, JSF RI 1.2_07, Facelets 1.1.14, Jetty 6.0.1, RichFaces 4.1.4GA
            Reporter: Claus Nyhus


Hi,

I think I have found a bug in the way the scrollableDataTable handles selection after a column has been sorted.

The problem can be seen by using the richfaces demo application.

Without sorting, select e.g. the first row in the table, and press the button to show the data from that row. Works fine. Now try and sort the second column, and after that again select the first row and press the button. The data that is show is the data that would have been in the first row if it had not been sorted.

My application is very similar to the example, except that the data is beeing shown in the table has an id. So I figured that I would have to use the rowKey attibute on the scrollableDataTable component in order for it to use the id of the data object instead of the default one. This looks like this:

 <rich:scrollableDataTable value="#{organisationsBB.organisations}" var="org" sortMode="single"
  		rowKey="${org.id}" selection="#{organisationsBB.selection}" id="organisationsTable">
...
</rich:scrollableDataTable>

When pressing the button, my action method does something like this:

  Iterator<SimpleRowKey> iterator = selection.getKeys();
  while(iterator.hasNext()) {
    SimpleRowKey key = iterator.next();
    int index = key.intValue();
  }

I would have thought that the value of "index" would have been the value of the id of my data object, but still, it is only the index into the list as it is presented in the table.

Am I doing something wrong here, or is this indeed a bug ?

Hope for your help

Cheers
/Claus





-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the richfaces-issues mailing list