how to give colspan and rowspan in JSF panelgrid?
A:
None of both is possible with the standard JSF implementation. There are 3 ways to fix this:
- Write plain HTML yourself. A
h:panelGrid
basically renders a HTML<table>
. Do the same. - Create a custom HTML renderer which supports this. It'll however be a lot of sweat and pain.
- Use a 3rd party component library which supports this.
- Tomahawk has a
t:panelGroup
component which supportscolspan
. - RichFaces has a
rich:column
component which supports bothcolspan
androwspan
.
- Tomahawk has a
BalusC
2010-06-24 15:17:37
Have you tried the rich:column in a panelgrid with colspan? Because the doc says: "The "colspan", "rowspan", and "breakbefore" attributes only affect columns in a <rich:dataTable>, not those in a <rich:extendedDataTable>."
volothamp
2010-10-13 16:14:28
A:
I agree with BalusC's answer and want to add, that the Primefaces JSF2 component library also offers this functionality if you use its p:dataTable component. It is called grouping there.
alfonx
2010-09-20 09:32:21