File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "grouping in datatable" Watch "grouping in datatable" New topic

grouping in datatable

Raj Purohit

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

Joined: Feb 04, 2006
Posts: 96

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

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

Joined: Feb 05, 2001
Posts: 17276

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.


Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
It is sorta covered in the JavaRanch Style Guide.
subject: grouping in datatable
It's not a secret anymore!