myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keel, Paul" <k...@ugs.com>
Subject RE: sort table (extension)
Date Wed, 04 May 2005 12:02:35 GMT
In the example, it is the sortColumn that specifies the sort method that
gets called: sortColumn="#{list.sort}". Keep in mind that 'list' is a
bean defined in the examples-config.xml file which refers to the class
SimpleSortableCarList.

The SortableList is just an abstract class so you have to implement a
concrete class (SimpleSortableCarList) that actually performs the sort.
The string that gets passed into sort is the id of the column, so in
your sort method you have to tell it how to sort that column.

Take a look in the example source code for SimpleSortableCarList.java.
You will have to provide a class like this to sort the columns in your
table. 

I hope that helps.

Paul



-----Original Message-----
From: Changzhou Wang [mailto:changzhouwang@gmail.com] 
Sent: Tuesday, May 03, 2005 9:15 PM
To: users@myfaces.apache.org
Subject: sort table (extension)

Hi All:

I am trying to combine a sortable table with a scrollable table.
However the sorting part does not work (though the sortTable example
comes with myfaces 1.0.9 works find), basically, the table is not
sorted even though the head is changed (with arrows) after the click.

In general, how does the UI component x:commandSortHeader knows what
action to take when the user click on the column? It seems the backing
bean (in SortableList.java) provides a "public void sort(String
column)" method, but I can not figure out where and how
x:commandSortHeader or its parent x:dataTable knows to invoke this
method? The x:dataTable only specifies the sortColumn and sortAscending.

Thanks,
czw



Mime
View raw message