users@glassfish.java.net

Data Grouping Display in JSF

From: <glassfish_at_javadesktop.org>
Date: Sun, 04 Mar 2007 05:51:15 PST

I have a collection of data that appears as the following:

Group1, Name1, Age1
Group1, Name2, Age2
Group2, Name3, Age3
Group2, Name4, Age4
Group3, Name5, Age5


What I would like to be able to do is output this data in a table in the following format:

Group1
&nbsp;&nbsp;Name1&nbsp;&nbsp;&nbsp;&nbsp;Age1
&nbsp;&nbsp;Name2&nbsp;&nbsp;&nbsp;&nbsp;Age2
Group2
&nbsp;&nbsp;Name3&nbsp;&nbsp;&nbsp;&nbsp;Age3
&nbsp;&nbsp;Name4&nbsp;&nbsp;&nbsp;&nbsp;Age4
Group3
&nbsp;&nbsp;Name5&nbsp;&nbsp;&nbsp;&nbsp;Age5

So the group label should have a colspan of 2 to span the length of the Name and Age columns.

The datatable component doesn't give me any control over the display of individual elements, so I cannot use that.

How can I go about creating the above data display in JSF?
[Message sent by forum member 'aantix' (aantix)]

http://forums.java.net/jive/thread.jspa?messageID=206108