wood burning stoves*
The moose likes JSF and the fly likes grouping in datatable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "grouping in datatable" Watch "grouping in datatable" New topic
Author

grouping in datatable

Raj Purohit
Greenhorn

Joined: Sep 26, 2007
Posts: 10
Hi,
How to group the rows in datatable?
Say for eg. I want to group the employee records acc to the location.
Thanks.
krishnamoorthy kitcha
Ranch Hand

Joined: Feb 04, 2006
Posts: 96
Hi

check this query

select empno,location from employee
group by empno,location

if the same employee have the different location

use like this

select empno from employee
group by empno
having count(location)>1
Raj Purohit
Greenhorn

Joined: Sep 26, 2007
Posts: 10
More specifically, I am using myfaces and <x:datatable> tag. I want to group the records in <x:datatable> in JSF.
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Well, not sure if you want to go to some other open source JSF Components, but the datatable in RichFaces allows subtables, which really help with grouping.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: grouping in datatable
 
Similar Threads
Game on SQL
getting object instance inside nested h:dataTable
How to show a panel or any other GUI object in OpenFaces 3.00 Datatable upon row selection?
Data from search not being dynamically added to rich:dataTable
datatable showing records partially