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
1993Marooncb1bda6e
1980Blueb93c7b09
Total:$92,512.00
BMW
1997Blackfd869936
1963Brownf56b0eb3
1961Green45750a30
1970Silverbfb255c3
1997Yellowddea82e5
Total:$6,347.00
Fiat
1997Brown17505cfb
1985Brown78a1eac7
1985Blacka4c34c8b
1995Green883b1864
2003Silver7276b035
1971Yellow8fa0d0a8
1988Red4df115be
1999Yellowdea7a265
Total:$63,155.00
Ford
1971Bluef15c0ccc
1986White884f2e0f
1998Browne773d0bd
1982Whitebd97a324
1998Yellow69c666bd
1960Red33ff943c
1980Maroon05e95eeb
2002Black44f28540
1970Black4f39982b
1987Black77ce4065
Total:$79,301.00
Honda
1980White7f7a6cec
1974Maroon0bda3cab
2008Silver37aa5eae
2004Red1a1add43
1978Maroonac256eb6
1976Black92c97d2e
Total:$56,513.00
Jaguar
2007Maroonbc3566b1
1965Greene28d232b
Total:$84,585.00
Mercedes
1986Red266ccf5e
1999Silverd7c327a0
1992Brown9c9c46be
2009Silver3502888e
Total:$44,672.00
Renault
1982Orangeeed4e249
1968Silverff485444
1980Black80e9e201
1998Yellow5d22e5a8
1982Reda9e62cd0
2003Bluea9afcd77
1964Maroon210ea5b8
Total:$28,176.00
Volkswagen
1964Maroon1b786e05
2008Brownd9159e23
1960Black912d33b1
Total:$84,664.00
Volvo
1971Red659f4a0d
1991Whitef3d6d121
1967Black6d9dbe0e
Total:$80,049.00

Rowspan

BrandYearColorId
Audi1993Marooncb1bda6e
Audi1980Blueb93c7b09
BMW1997Blackfd869936
BMW1963Brownf56b0eb3
BMW1961Green45750a30
BMW1970Silverbfb255c3
BMW1997Yellowddea82e5
Fiat1997Brown17505cfb
Fiat1985Brown78a1eac7
Fiat1985Blacka4c34c8b
Fiat1995Green883b1864
Fiat2003Silver7276b035
Fiat1971Yellow8fa0d0a8
Fiat1988Red4df115be
Fiat1999Yellowdea7a265
Ford1971Bluef15c0ccc
Ford1986White884f2e0f
Ford1998Browne773d0bd
Ford1982Whitebd97a324
Ford1998Yellow69c666bd
Ford1960Red33ff943c
Ford1980Maroon05e95eeb
Ford2002Black44f28540
Ford1970Black4f39982b
Ford1987Black77ce4065
Honda1980White7f7a6cec
Honda1974Maroon0bda3cab
Honda2008Silver37aa5eae
Honda2004Red1a1add43
Honda1978Maroonac256eb6
Honda1976Black92c97d2e
Jaguar2007Maroonbc3566b1
Jaguar1965Greene28d232b
Mercedes1986Red266ccf5e
Mercedes1999Silverd7c327a0
Mercedes1992Brown9c9c46be
Mercedes2009Silver3502888e
Renault1982Orangeeed4e249
Renault1968Silverff485444
Renault1980Black80e9e201
Renault1998Yellow5d22e5a8
Renault1982Reda9e62cd0
Renault2003Bluea9afcd77
Renault1964Maroon210ea5b8
Volkswagen1964Maroon1b786e05
Volkswagen2008Brownd9159e23
Volkswagen1960Black912d33b1
Volvo1971Red659f4a0d
Volvo1991Whitef3d6d121
Volvo1967Black6d9dbe0e
<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.