DataTable - Row Grouping - since v6.0.11 Rows can be grouped in two ways, using rowGroup component or with groupRow attribute on a column.

Header Row

YearColorId
Audi
2003Blueec2c6fa2
1963Greenaaa352a8
1979Maroonb9236011
1964Maroonaf38706b
1991Whitea5bb16db
2003Brown8d4ed721
1973Brown59eb971b
1980Whited2cebade
1977Red48792fd0
Total:$3,677.00
BMW
1991Blackeb86f156
1991Silver2bfd1626
2007Blue86fc559b
Total:$39,877.00
Fiat
1986Bluea9d8a1f0
1999Orange8b34e32c
1995Red9e616d7c
1964Blacke3bd9b87
Total:$24,779.00
Ford
1978Brownaeb2f275
1963Reddfb3a5bb
1984Whitefe064123
1970Maroonb14d89a5
1980Red499d2f4b
1996Orange6c63dd72
Total:$87,457.00
Honda
1960Black3a82e17c
1991Green06340284
1987Silverf4410790
Total:$99,160.00
Jaguar
1981Orangecbea630f
1975Yellowd1fe1787
Total:$17,172.00
Mercedes
1984Blacka2fc5a7d
1961Brown0fab39f0
1963Blued3ac0158
1967Bluef77d1744
1970Green3c09e0d3
1991Brown0df327cc
1996Blue31912dc2
Total:$6,280.00
Renault
2005Orange836cc9c3
1997Bluea32f53ac
2002Red060d7651
1962Bluee4e427b2
1976Brown1b8aa1f3
1986Blue7ec76f18
Total:$45,063.00
Volkswagen
1975Orangec77b8972
1991Silver5a41a6ea
1984Green6c21fef2
Total:$23,083.00
Volvo
2001Whitef57569a0
1975Blackd14e8cc8
1991White66715453
1965Black1248d4e2
1994Bluef693cf82
1994Orange9762e2f3
2006Maroone0cf40ff
Total:$46,359.00

Rowspan

BrandYearColorId
Audi2003Blueec2c6fa2
Audi1963Greenaaa352a8
Audi1979Maroonb9236011
Audi1964Maroonaf38706b
Audi1991Whitea5bb16db
Audi2003Brown8d4ed721
Audi1973Brown59eb971b
Audi1980Whited2cebade
Audi1977Red48792fd0
BMW1991Blackeb86f156
BMW1991Silver2bfd1626
BMW2007Blue86fc559b
Fiat1986Bluea9d8a1f0
Fiat1999Orange8b34e32c
Fiat1995Red9e616d7c
Fiat1964Blacke3bd9b87
Ford1978Brownaeb2f275
Ford1963Reddfb3a5bb
Ford1984Whitefe064123
Ford1970Maroonb14d89a5
Ford1980Red499d2f4b
Ford1996Orange6c63dd72
Honda1960Black3a82e17c
Honda1991Green06340284
Honda1987Silverf4410790
Jaguar1981Orangecbea630f
Jaguar1975Yellowd1fe1787
Mercedes1984Blacka2fc5a7d
Mercedes1961Brown0fab39f0
Mercedes1963Blued3ac0158
Mercedes1967Bluef77d1744
Mercedes1970Green3c09e0d3
Mercedes1991Brown0df327cc
Mercedes1996Blue31912dc2
Renault2005Orange836cc9c3
Renault1997Bluea32f53ac
Renault2002Red060d7651
Renault1962Bluee4e427b2
Renault1976Brown1b8aa1f3
Renault1986Blue7ec76f18
Volkswagen1975Orangec77b8972
Volkswagen1991Silver5a41a6ea
Volkswagen1984Green6c21fef2
Volvo2001Whitef57569a0
Volvo1975Blackd14e8cc8
Volvo1991White66715453
Volvo1965Black1248d4e2
Volvo1994Bluef693cf82
Volvo1994Orange9762e2f3
Volvo2006Maroone0cf40ff
<h3 class="first">Header Row</h3>
<h:form>
    <p:dataTable var="car" value="#{dtRowGroupView.cars}" sortBy="#{car.brand}" expandableRowGroups="true">
        <p:headerRow>
            <p:column colspan="3">
                <h:outputText value="#{car.brand}" />
            </p:column>
        </p:headerRow>
        <p:column headerText="Year">
            <h:outputText value="#{car.year}" />
        </p:column>
        <p:column headerText="Color">
            <h:outputText value="#{car.color}" />
        </p:column>
        <p:column headerText="Id">
            <h:outputText value="#{car.id}" />
        </p:column>
        <p:summaryRow>
            <p:column colspan="2" style="text-align:right">
                <h:outputText value="Total:" />
            </p:column>
            <p:column>
                <h:outputText value="#{dtRowGroupView.randomPrice}">
                    <f:convertNumber type="currency" currencySymbol="$" />
                </h:outputText>
            </p:column>
        </p:summaryRow>
    </p:dataTable>
</h:form>

<h3>Rowspan</h3>
<h:form>
    <p:dataTable var="car" value="#{dtRowGroupView.cars}" sortBy="#{car.brand}">
        <p:column headerText="Brand" groupRow="true">
            <h:outputText value="#{car.brand}" />
        </p:column>
        <p:column headerText="Year">
            <h:outputText value="#{car.year}" />
        </p:column>
        <p:column headerText="Color">
            <h:outputText value="#{car.color}" />
        </p:column>
        <p:column headerText="Id">
            <h:outputText value="#{car.id}" />
        </p:column>
    </p:dataTable>
</h:form>
                
PrimeTek, Copyright © 2015
All rights reserved.
Running PrimeFaces-6.0.16 on Mojarra-2.2.8.