wood burning stoves 2.0*
The moose likes JSF and the fly likes Tomahawk dataTable sorting problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Tomahawk dataTable sorting problem" Watch "Tomahawk dataTable sorting problem" New topic
Author

Tomahawk dataTable sorting problem

Markus Schmider
Ranch Hand

Joined: Feb 25, 2007
Posts: 103
Hello,
I am trying to use t:dataTable from Tomahawk to build a sortable table. The sort criteria (column which is used for sorting, asc vs. desc) should persist (in the session) so that when the use comes back to table after visiting other pages the same sort criteria should be automatically applied he used the last time.
After perusing the API I thought this should be possible with these attributes.


However I cannot make it work. The sorting criteria are stored in my backing bean, but when I navigate back to the table they are not applied.

I am using tomahawk-1.1.7.jar on JBoss 4.2.2.GA







I would greatly appreciate any help

Thanks,

Hans
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

I'd like to know too. I've tried to use the "Automatically sortable by choosen columns" example (which look like yours) from myfaces-example-simple-1.1.7, just changing the backing bean's scope from request to session, but it didn't work either. Only the sorted column header is preserved, not the data itself...


[My Blog]
All roads lead to JavaRanch
Markus Schmider
Ranch Hand

Joined: Feb 25, 2007
Posts: 103
I have chosen an alternative approach, you can preserve the sorting, when you update the model itself.

You have to use <t:commandSortHeader> and do the sorting in the backing when ever the properties bound to sortColumn or sortAscending attributes are changed.
So far have not found another solution.

Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

As explained here, I would have thought that we do not need to bother with the sorting stuff, as it says "the sort(String column) method is not needed any more in your backing bean".
Klaus Schuster
Ranch Hand

Joined: Feb 10, 2009
Posts: 30
I also have the problem, that I use the sorting of the datatable. if I click the column labels, everything works fine.
After leaving the page or navigating to another and go back to the page, the sorting does not work anymore.
I want to have to same sorted view as I left the page.

Is there any Action necessary to start the sorting? I use the <t:column sortable="true"> with nested <t:commandSortHeader...> tags.
If someone solved the problem, please reply.
Thanks.

PS: the use of <t:column defaultSorted="true"... is a bug of Tomahawk.
Tomahawk BUG
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomahawk dataTable sorting problem