Is it possible to add Row headers to a JSF or PrimeFaces datatable?

4.3k Views Asked by At

Well, I've been looking for any examples but all I could find was just examples in plain Java but I need to do something like this one or this other but in a JSF or PrimeFaces component.

2

There are 2 best solutions below

0
On BEST ANSWER

The h:column tag has a property called rowHeader that does what you need.

5
On

Maybe this is what you are looking for:

<f:facet name="header">
  Row Header Example
</f:facet>

Here is the complete example: Primefaces showcase - DataTable - Group 1

I think you want something like a horizontal header, a don't think primefaces has it, but you can change the style of first cell like this:

<p:column headerText="Id"> 
    <h:outputText value="#{car.id}" styleClass="someCssClass" /> 
</p:column>