• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Tomahawk dataTable sorting problem

 
Ranch Hand
Posts: 153
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 153
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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".
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic