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
1988Silver55e5d880
Total:$88,946.00
BMW
1982Maroon5a38a3b2
1975White03ee361a
1988Silver67ea0556
1995Brown47c80f7e
1991Blue279d0370
1960Blackd1203cab
Total:$87,744.00
Fiat
1967Yellowb62179d6
1961Greenfb91aea9
1969Black309fb078
1967Maroon0585b7de
2003Blueb0e5b329
Total:$24,594.00
Ford
1960Brown50bc342a
1997Silverbbbf77f9
1986Black1b426b79
1986Greene22384ed
2007White37949d30
Total:$25,964.00
Honda
1991Silver0d5dcceb
1985White650b7d74
1988Red84272210
2003Greene646b118
1968White7d0632fb
Total:$9,077.00
Jaguar
2008Orange72639622
1975Greencd335881
1965Silver2e4302dd
1969Silver57aab327
1968Green4a44757e
2000Whiteab882c8a
1968Whitee9ed2575
Total:$77,746.00
Renault
1978Green684a9e59
2007Silver408b407c
2006Red00a4d7be
1972Blue0c628e9b
2007Bluea34b0d16
Total:$88,211.00
Volkswagen
1962Whiteff779958
1988Red0afee81b
1980Maroon56239158
1980Silverf2feb5ab
1972Brown45a71f8a
1988Greene44209aa
1965Whiteeb3da9ff
Total:$2,905.00
Volvo
1980Green72809b43
1962Maroon13ecafb4
1986Brownd946e4de
2006Rede8af0c0d
2008Maroona2b5a884
1978Whitee91f59e4
1977Red4b2b1521
1990Black6c8e6a81
2007Yellowdc169640
Total:$53,596.00

Rowspan

BrandYearColorId
Audi1988Silver55e5d880
BMW1982Maroon5a38a3b2
BMW1975White03ee361a
BMW1988Silver67ea0556
BMW1995Brown47c80f7e
BMW1991Blue279d0370
BMW1960Blackd1203cab
Fiat1967Yellowb62179d6
Fiat1961Greenfb91aea9
Fiat1969Black309fb078
Fiat1967Maroon0585b7de
Fiat2003Blueb0e5b329
Ford1960Brown50bc342a
Ford1997Silverbbbf77f9
Ford1986Black1b426b79
Ford1986Greene22384ed
Ford2007White37949d30
Honda1991Silver0d5dcceb
Honda1985White650b7d74
Honda1988Red84272210
Honda2003Greene646b118
Honda1968White7d0632fb
Jaguar2008Orange72639622
Jaguar1975Greencd335881
Jaguar1965Silver2e4302dd
Jaguar1969Silver57aab327
Jaguar1968Green4a44757e
Jaguar2000Whiteab882c8a
Jaguar1968Whitee9ed2575
Renault1978Green684a9e59
Renault2007Silver408b407c
Renault2006Red00a4d7be
Renault1972Blue0c628e9b
Renault2007Bluea34b0d16
Volkswagen1962Whiteff779958
Volkswagen1988Red0afee81b
Volkswagen1980Maroon56239158
Volkswagen1980Silverf2feb5ab
Volkswagen1972Brown45a71f8a
Volkswagen1988Greene44209aa
Volkswagen1965Whiteeb3da9ff
Volvo1980Green72809b43
Volvo1962Maroon13ecafb4
Volvo1986Brownd946e4de
Volvo2006Rede8af0c0d
Volvo2008Maroona2b5a884
Volvo1978Whitee91f59e4
Volvo1977Red4b2b1521
Volvo1990Black6c8e6a81
Volvo2007Yellowdc169640
<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.1-SNAPSHOT on Mojarra-2.2.8.