My goal is to produce a table with two header rows. The first with a few column-spanning cells, the second with all 1-cell headers, but with sortBy and filterBy enabled.
<p:dataTable .... >
<p:columnGroup type="header">
<p:row>
<p:column colspan="3" headerText="my header 1" />
<p:column colspan="3" headerText="my header 2" />
</p:row>
</p:columnGroup>
<p:column sortBy="#{myBean.var1}" filterBy="#{myBean.var1}" headerText="var1">
<h:outputText value="#{...var1}" />
</p:column>
.
.
</p:dataTable>
I can get either the columnGroup to show up or the per-column headerText with sortBy and filterBy, but not both. When I mix them, the header components from the per-column header row disappears.
As it turns out, it is possible to nest dataTables via the subTable component. This showcase example demonstrates nesting a subTable in a larger dataTable, there-by achieving filtering and sorting combined with columnGroups in the headers.