wood burning stoves*
The moose likes JSF and the fly likes Mulitple headings for sortable datatable column? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Mulitple headings for sortable datatable column?" Watch "Mulitple headings for sortable datatable column?" New topic
Author

Mulitple headings for sortable datatable column?

Damien Edison
Greenhorn

Joined: Jan 14, 2009
Posts: 3
Hi!

I have built a datatable using jsf and tomahawk. It looks somewhat simplyfied like this:



As you can see a have a backing bean called testUseCaseBean used to retrieve the transactions that populates the table. What I would like to do is to split the heading (Name / date) of this first column (only one visable in the example) and fil it with both both name and date in each row. Then I would like to be able to sort the column clicking either date or name. The problem for me is that only one header is allowed and that each sortable column only can send one value to the useCaseBean.

Does anyone know if there is a solution for this using jsf?
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

I found the h:dataTable runs out of steam quickly when you want to perform even relative simple customizations. I found writing a custom bean was the solution for many extensions like these, or perhaps use something like the RichFaces extended datatable component.

-Cameron McKenzie
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16137
    
  21

I don't quite follow all that - it sounds like you want to have 1 column that acts like 2 columns. But you might want to look at the RichFaces extended datatable control. It has a fairly rich set of both formatting and sorting options, and RichFaces and Tomahawk can co-exist fairly well (I'm doing that right now).


Customer surveys are for companies who didn't pay proper attention to begin with.
Damien Edison
Greenhorn

Joined: Jan 14, 2009
Posts: 3
Tim Holloway wrote:I don't quite follow all that - it sounds like you want to have 1 column that acts like 2 columns. But you might want to look at the RichFaces extended datatable control. It has a fairly rich set of both formatting and sorting options, and RichFaces and Tomahawk can co-exist fairly well (I'm doing that right now).


Yes that is correct. I want to place the name and date in the same column with the date on top. This because I want to save table witdh as I will have a lot of more columns not introduced in the example code. Thanks for your answers, I'll look into the RichFaces extended datatable control.

/Dejmien
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mulitple headings for sortable datatable column?