Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomahawk dataTable sorting problem

 
Markus Schmider
Ranch Hand
Posts: 130
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Markus Schmider
Ranch Hand
Posts: 130
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic