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
1969Maroonec6eff82
1969Maroonec6eff82
1983Red256db96e
1986Black867256b7
Total:$77,128.00
BMW
2002Orange382b0742
2002Orange382b0742
2009Silver5b638f01
2006Silver3aea9144
1983Red42f917ea
Total:$15,256.00
Fiat
1993Silver417b3bb5
1993Silver417b3bb5
1993Orange1cf3a307
2002Redbbc7dd75
1962Blueb2f8ab61
1995Black3b1762f6
Total:$94,782.00
Ford
2007Black4cd07d04
2007Black4cd07d04
1962Orangeb9de62a9
1977Silver44538908
2009Orangeb3c8345c
Total:$64,052.00
Honda
1964Silver378a3051
1964Silver378a3051
1970Yellow8dc17c20
1962Orange739fe3a3
1978Blackd7790690
1963Blue28aac187
1981Redddf5736f
Total:$33,405.00
Jaguar
1999Silvera55fa11d
1999Silvera55fa11d
Total:$35,483.00
Mercedes
1975White702e5c6a
1975White702e5c6a
1985Silver4076b48b
1995Reded02dee3
1961Blackc5f414fc
1962Orange2056d3e8
Total:$52,895.00
Renault
2003Redb109946c
2003Redb109946c
2003Bluedc616a68
1992Maroonc5616a2a
Total:$84,049.00
Volkswagen
2002Black9d8e37bc
2002Black9d8e37bc
1988Orange727c4641
1997White486de281
1967Blue79f3be9a
2001Silvercd79a3e0
1976Maroon8a13d47d
Total:$73,590.00
Volvo
1998Red3a6d72c0
1998Red3a6d72c0
1979Yellowb778ac77
1960Brownf79849b3
Total:$67,281.00

Rowspan

BrandYearColorId
Audi1969Maroonec6eff82
Audi1983Red256db96e
Audi1986Black867256b7
Audi2001Brownd747c7f3
BMW2002Orange382b0742
BMW2009Silver5b638f01
BMW2006Silver3aea9144
BMW1983Red42f917ea
BMW1988Whitee62a2c70
Fiat1993Silver417b3bb5
Fiat1993Orange1cf3a307
Fiat2002Redbbc7dd75
Fiat1962Blueb2f8ab61
Fiat1995Black3b1762f6
Fiat1981Maroon808c79c7
Ford2007Black4cd07d04
Ford1962Orangeb9de62a9
Ford1977Silver44538908
Ford2009Orangeb3c8345c
Ford1973White4e15af3c
Honda1964Silver378a3051
Honda1970Yellow8dc17c20
Honda1962Orange739fe3a3
Honda1978Blackd7790690
Honda1963Blue28aac187
Honda1981Redddf5736f
Honda1992Brown85b04adb
Jaguar1999Silvera55fa11d
Jaguar1971Brownebe34610
Mercedes1975White702e5c6a
Mercedes1985Silver4076b48b
Mercedes1995Reded02dee3
Mercedes1961Blackc5f414fc
Mercedes1962Orange2056d3e8
Mercedes1960Maroon8df4e4e5
Renault2003Redb109946c
Renault2003Bluedc616a68
Renault1992Maroonc5616a2a
Renault1985Green748ca0fb
Volkswagen2002Black9d8e37bc
Volkswagen1988Orange727c4641
Volkswagen1997White486de281
Volkswagen1967Blue79f3be9a
Volkswagen2001Silvercd79a3e0
Volkswagen1976Maroon8a13d47d
Volkswagen1997Black1e5502b7
Volvo1998Red3a6d72c0
Volvo1979Yellowb778ac77
Volvo1960Brownf79849b3
Volvo1986Silver2aef1dc9
<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.14 on Mojarra-2.2.8.