Hi,
This is my first post so please excuse me if I'm not doing this
correctly.
I have a question regarding the sortable datatable example in myFaces.
I'm working implementing a similar example as the one provided so I
figured it should not be too complicated but yet I'm running into some
problems...
In the sources of the examples, SimpleSortableCarList.java contains the
following:
public List getCars()
{
sort(getSort(), isAscending());
return _cars;
}
As I understand it, this means that the list will be sorted several
times before the page is rendered, which is not that great as I
understand it, I think we could all agree on that.
Now, in order to go around this problem, I implemented an action in the
<commandSortHeader> to perform the sorting. However, as you can imagine,
I do not have access to the newly clicked column name when I perform the
sorting as the Action is called before the setSortColumn, which is
normal.
So my question is mainly this: am I getting the purpose of this
component wrong? Is there a way to make it work calling a sorting method
only once or do I need to code my own way to perform a sorting only when
required when I call the getCars() method?
Thanks in advance,
Gregory