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
1983Redd558f818
1975Brown6a68a324
1965Blackbd7df0cc
1969White73be1e16
1992White5db7a10d
1965Red152241ca
1998Orange7e5bc74c
Total:$85,963.00
BMW
1996Bluef413c9ac
1991Yellow74e0d863
1981Silver9d126d2c
Total:$66,749.00
Fiat
1983Whitefbe7e0ad
1992White4aaf4fee
1976Blued0d70500
1982Yellowca2a0c55
1975Blackc4870b8c
2007Brownb8cc973a
1976Maroon66cbd7c1
1987Orange71d4ed38
Total:$61,921.00
Ford
1979Blacka6ebd54a
Total:$96,260.00
Honda
1969Whitef04df6eb
1987Maroond150f267
1971Maroon294a8760
2001Red6b0d7102
1963Maroon1b6547d5
1965Blue891dc3d2
Total:$11,219.00
Jaguar
1963Blue735286c1
1962Bluefc7160d9
2007Maroon7eec29d5
1996Silver862f6396
2008Redb02d76b2
1960Yellow321e401c
Total:$23,309.00
Mercedes
1994Bluec5956bb5
1974Red82b724b8
1967Maroona0a0d6ff
Total:$85,762.00
Renault
1979Silver21415c7e
1990Orange04e458b7
1978Redb4b24c2d
1990Blue2a77f7ed
Total:$36,876.00
Volkswagen
1964Greenad3e143d
1986Red17874f7f
1969Redfb38222c
1975Redd8e67313
2008Black6329801e
1972Red85cbd35e
2004Silverb62c3e67
Total:$97,277.00
Volvo
2002Orange3a6fc091
1972Silverc00cd5d0
1983Blue7cfa49a5
1984Maroonc41884f0
1961White7af9f680
Total:$12,300.00

Rowspan

BrandYearColorId
Audi1983Redd558f818
Audi1975Brown6a68a324
Audi1965Blackbd7df0cc
Audi1969White73be1e16
Audi1992White5db7a10d
Audi1965Red152241ca
Audi1998Orange7e5bc74c
BMW1996Bluef413c9ac
BMW1991Yellow74e0d863
BMW1981Silver9d126d2c
Fiat1983Whitefbe7e0ad
Fiat1992White4aaf4fee
Fiat1976Blued0d70500
Fiat1982Yellowca2a0c55
Fiat1975Blackc4870b8c
Fiat2007Brownb8cc973a
Fiat1976Maroon66cbd7c1
Fiat1987Orange71d4ed38
Ford1979Blacka6ebd54a
Honda1969Whitef04df6eb
Honda1987Maroond150f267
Honda1971Maroon294a8760
Honda2001Red6b0d7102
Honda1963Maroon1b6547d5
Honda1965Blue891dc3d2
Jaguar1963Blue735286c1
Jaguar1962Bluefc7160d9
Jaguar2007Maroon7eec29d5
Jaguar1996Silver862f6396
Jaguar2008Redb02d76b2
Jaguar1960Yellow321e401c
Mercedes1994Bluec5956bb5
Mercedes1974Red82b724b8
Mercedes1967Maroona0a0d6ff
Renault1979Silver21415c7e
Renault1990Orange04e458b7
Renault1978Redb4b24c2d
Renault1990Blue2a77f7ed
Volkswagen1964Greenad3e143d
Volkswagen1986Red17874f7f
Volkswagen1969Redfb38222c
Volkswagen1975Redd8e67313
Volkswagen2008Black6329801e
Volkswagen1972Red85cbd35e
Volkswagen2004Silverb62c3e67
Volvo2002Orange3a6fc091
Volvo1972Silverc00cd5d0
Volvo1983Blue7cfa49a5
Volvo1984Maroonc41884f0
Volvo1961White7af9f680
<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 © 2017
All rights reserved.
Running PrimeFaces-6.2-SNAPSHOT on Mojarra-2.3.2.