• Settings
    • Locale
    • Change the locale of the datepicker, schedule and client side validation messages.

      Language
      English
      English
      English
      French
      German
      German
      German
      Italian
      Korean
      Spanish
      Catalan
      Dutch
      Portuguese
      Portuguese
      Arabic
      Arabic
      Bulgarian
      Bangla
      Bosnian
      Czech
      Greek
      Estonian
      Persian
      Finnish
      Danish
      Hindi
      Indonesian
      Icelandic
      Croatian
      Japanese
      Hungarian
      Hebrew
      Georgian
      Central Kurdish
      Khmer
      Kyrgyz
      Kazakh
      Lithuanian
      Latvian
      Malay
      Norwegian
      Polish
      Romanian
      Russian
      Slovak
      Slovenian
      Serbian
      Serbian
      Swedish
      Thai
      Turkish
      Ukrainian
      Uzbek
      Vietnamese
      Chinese
      Chinese
  • Resources
Theme
Theme
Preset primefaces.THEME
Apple Liquid Glass style: translucent overlays, menus and bars that blur the page behind them, capsule buttons.
Color scheme color-scheme
Input style p-input-filled
Density data-p-density
Direction primefaces.DIR
Colors
Primary --p-primary-base
Surface --p-surface-*
Shape and motion
Button shape --p-button-border-radius
Shadows --p-*-shadow
Animations --p-transition-duration
Ripple --p-ripple-opacity
Border radius --p-border-radius-*
Typography
Focus ring
Form field
CSS
Only the tokens that differ from the preset.

                        
                    

DataTable Row Group

Rows can be grouped using the headerRow and summaryRow components or with the groupRow attribute on a column.

DataTable Tag Documentation

DataTable is an enhanced version of the standard Datatable that provides built-in solutions to many commons use cases like paging, sorting, selection, lazy loading, filtering and more.

NameTypeRequiredDefaultDescription
id String false generated Unique identifier of the component in a namingContainer.
rendered boolean false true Boolean value to specify the rendering of the component, when set to false component will not be rendered.
binding UIComponent false generated An EL expression referring to a server side UIComponent instance in a backing bean.
widgetVar String false generated ('widget_' + componentClientId) Name of the client side widget.
allowUnsorting boolean false false Defines whether columns are allowed to be unsorted.
ariaRowLabel String false Label to read by screen readers on checkbox and radio selection.
cellEditMode String false eager Defines the cell edit behavior, valid values are "eager" and "lazy".
cellNavigation boolean false true Enables cell navigation with the keyboard for WCAG and screen reader compliance.
cellSeparator String false Separator text to use in output mode of editable cells with multiple components.
clientCache boolean false false Caches the next page asynchronously.
currentPageReportTemplate String false ({currentPage} of {totalPages}) Template of the currentPageReport UI.
dataLocale Object false The view locale Locale to be used in features such as sorting.
dir String false ltr Defines text direction, valid values are ltr and rtl.
disableContextMenuIfEmpty boolean false false Decides whether to disable context menu or not if a table has no records.
draggableColumns boolean false false Decides whether datatable columns can be reordered using dragdrop.
draggableRows boolean false false When enabled, rows can be reordered using dragdrop.
draggableRowsFunction MethodExpression false Method expression to execute after dragging row.
editInitEvent String false click Defines a client side event to open cell on editable table.
editMode String false row Defines edit mode, valid values are "row" and "cell".
editable boolean false false Controls incell editing.
editingRow boolean false false Defines if cell editors of row should be displayed as editable or not. False means display mode.
emptyMessage String false i18n Text to display when there is no data to display.
escapeText boolean false true Defines if headerText and footerText values on columns are escaped or not.
expandedRow boolean false false Defines if row should be rendered as expanded by default.
exportRowTag String false If XML data exporter in use, this allows customization of the row tag in the XML.
exportTag String false If XML data exporter in use, this allows customization of the document tag in the XML.
filterBy Object false Property to be used for filtering.
filterDelay int false 300 Delay to wait in milliseconds before sending each filter query.
filterEvent String false keyup Client side event to invoke filtering. If "enter" it will only filter after ENTER key is pressed.
filterNormalize boolean false false Defines if filtering would be done using normalized values (accents will be removed from characters).
filteredValue Object false List to keep the filtered data if filtering is enabled.
first int false 0 Index of the first data to display.
frozenColumns int false 0 Number of columns to freeze
frozenColumnsAlignment String false left Defines the alignment of frozen columns, valid values are 'left' and 'right'.
frozenRows int false 0 Number of rows to freeze starting from the beginning.
globalFilter String false Value of the global filter to use when filtering by default.
globalFilterFunction MethodExpression false Custom implementation to globally filter a value against a constraint.
globalFilterOnly boolean false false When true this will hide all column filters and allow all columns to be filtered by global filter only.
lazy boolean false True, if the value-binding is instance of LazyDataModel. Defines if lazy loading is enabled for the data component.
liveResize boolean false false Columns are resized live in this mode without using a resize helper.
liveScroll boolean false false Enables live scrolling.
liveScrollBuffer int false 0 Percentage height of the buffer between the bottom of the page and the scroll position to initiate the load for the new chunk. Value is defined in integer.
multiViewState boolean false false Whether to keep component state across views.
nativeElements boolean false false In native mode, treetable uses native checkboxes.
onExpandStart String false Client side callback to execute before row expansion.
onRowClick String false Client side callback to execute after clicking row.
pageLinks int false 10 Maximum number of page links to display.
paginator boolean false false Enables pagination.
paginatorAlwaysVisible boolean false true Defines if paginator should be hidden if total data count is less than number of rows per page.
paginatorPosition String false bottom Position of the paginator.
paginatorTemplate String false {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} Template of the paginator.
partialUpdate boolean false true When disabled, it updates the whole table instead of updating a specific field such as body element in the client requests of the dataTable.
reflow boolean false false Reflow mode is a responsive mode to display columns as stacked depending on screen size.
renderEmptyFacets boolean false false Render facets even if their children are not rendered.
resizableColumns boolean false false Decides whether datatable columns are resizable or not.
resizeMode String false fit Defines the resize behavior, valid values are "fit" and expand.
rowDragSelector String false td,span:not(.p-c) Defines the element used to reorder rows using dragdrop.
rowEditMode String false eager Defines the row edit behavior, valid values are "eager" and "lazy".
rowExpandMode String false multiple Defines row expand mode, valid values are "single" and "multiple".
rowHover boolean false false Adds hover effect to rows, default is false. Hover is always on when selection is enabled.
rowIndexVar String false Name of iterator to refer each row index.
rowKey String false Unique identifier of row data.
rowSelector String false Client side check if rowclick triggered row click event not a clickable element in row content.
rowStatePreserved boolean false false Keeps state of its children on a per-row basis.
rowStyleClass String false Style class for each row.
rowTitle String false Title for each row.
rows int false 0 Number of rows to display per page. Default value is 0 meaning to display all data available.
rowsPerPageTemplate String false Template of the rowsPerPage dropdown.
saveOnCellBlur boolean false true Saves the changes in cell editing on blur, when set to false changes are discarded.
scrollHeight String false Height for scrollable data.
scrollRows int false 0 Number of rows to display in virtual scrolling mode.
scrollWidth String false Width for scrollable data.
scrollable boolean false false Makes data scrollable with fixed header.
selectAllFilteredOnly boolean false false When enabled, toggle select will only apply on filtered items.
selection Object false Reference to the selection data.
selectionDisabled boolean false false Disables row selection when true.
selectionMode String false Detected though the "selection" value expression. Enables data selection, valid values are "single" and "multiple".
selectionPageOnly boolean false true When using paginator and checkbox selection mode the select all checkbox in header will select the current page if true or all rows if false. When false, individual row unselections after 'select all' are preserved even across page navigation.
selectionRowMode String false new Indicates how rows of a DataTable may be selected, when clicking on the row itself (not the checkbox / radiobutton from p:column). The value `new` always unselects other rows, `add` preserves the currently selected rows, and `none` disables row selection.
selectionTextDisabled boolean false true Disables text selection on row click.
showGridlines boolean false false When enables, cell borders are displayed.
showSelectAll boolean false true Whether to show the select all checkbox inside the column's header.
size String false regular Size of the table content, valid values are "small", "regular" and "large".
skipChildren boolean false false Ignores processing of children during lifecycle, improves performance if table only has output components.
sortBy Object false Property to be used for sorting.
sortMode String false multiple Defines sorting mode, valid values are "single" and "multiple".
stickyHeader boolean false false Sticky header stays in window viewport during scrolling.
stickyTopAt String false Selector to position on the page according to other fixing elements on the top of the table.
stripedRows boolean false false Whether to display striped rows to visually separate content.
style String false Inline style of the component.
styleClass String false Style class of the component.
summary String false Summary attribute for WCAG.
tabindex String false 0 Position of the element in the tabbing order.
tableStyle String false Inline style of the table element.
tableStyleClass String false Style class of the table element.
touchable Boolean false Enable touch if supported by device. NULL uses global default or primefaces.TOUCHABLE. Default: globally enabled.
value Object true Datasource of the component.
var String true Name of the iterator variable that references each element in the data set.
virtualScroll boolean false false Loads data on demand as the scrollbar gets close to the bottom.
Loading...
Tag Documentation Documentation Documentation JSDoc Basic ColumnToggler ContextMenu Crud DisplayPriority Dynamic Columns Edit Facets Field Filter Gridlines Group Lazy MultiViewState Paginator Reorder Resize Responsive RowAdd RowColor RowExpansion RowGroup RowHeader RowTitle RTL Scroll Selection Size Sort StickyHeader StripedRows SubTable
Header Row
RepresentativeNameCountryCompanyStatusDate
Amy Elsner
Amy ElsnerJulie Y Dilliard CanadaDorl, James J Esq RENEWAL10/31/2026
Amy ElsnerMujtaba S Maclead JapanChanay, Jeffrey A Esq NEGOTIATION11/09/2026
Amy ElsnerTony G Perin United KingdomFeiner Bros NEGOTIATION11/06/2026
Amy ElsnerClifford X Ferencz IndiaChanay, Jeffrey A Esq PROPOSAL10/18/2026
Total Customers:4
Anna Fali
Anna FaliMunro D Poquette IndiaFeiner Bros QUALIFIED11/07/2026
Anna FaliJulie C Saylors GermanyMorlong Associates NEW10/24/2026
Anna FaliMujtaba F Ostrosky ItalyFeltz Printing Service RENEWAL11/05/2026
Anna FaliKadeem C Morasca GermanyTruhlar And Truhlar Attys UNQUALIFIED10/20/2026
Anna FaliArvin K Wieser SpainPrinting Dimensions NEW10/27/2026
Total Customers:5
Asiya Javayant
Asiya JavayantJones L Chui FranceTruhlar And Truhlar Attys RENEWAL11/09/2026
Asiya JavayantClaire A Saylors CanadaChapman, Ross E Esq NEW10/29/2026
Asiya JavayantMaisha Q Inouye CanadaKing, Christopher A Esq NEGOTIATION10/31/2026
Asiya JavayantJeanfrancois N Maclead FranceRousseaux, Michael Esq NEW11/06/2026
Asiya JavayantAdams Y Figeroa IndiaFeiner Bros RENEWAL10/31/2026
Asiya JavayantSalvatore P Foller United KingdomFeiner Bros RENEWAL10/22/2026
Asiya JavayantFaith J Bowley GermanyRousseaux, Michael Esq QUALIFIED10/15/2026
Asiya JavayantJulie R Stenseth ItalyBuckley Miller Wright QUALIFIED10/25/2026
Total Customers:8
Bernardo Dominic
Bernardo DominicMisaki J Ostrosky AustraliaChanay, Jeffrey A Esq UNQUALIFIED10/28/2026
Bernardo DominicNicolas R Whobrey JapanBuckley Miller Wright NEGOTIATION10/19/2026
Bernardo DominicKaitlin H Whobrey JapanBenton, John B Jr RENEWAL11/03/2026
Bernardo DominicCosta W Bowley IndiaPrinting Dimensions RENEWAL10/25/2026
Bernardo DominicIzzy G Oldroyd AustraliaBuckley Miller Wright QUALIFIED10/18/2026
Bernardo DominicJuan J Chui RussiaBenton, John B Jr NEGOTIATION10/31/2026
Bernardo DominicJeanfrancois O Amigon CanadaTruhlar And Truhlar Attys UNQUALIFIED11/03/2026
Total Customers:7
Elwin Sharvill
Elwin SharvillSilvio H Darakjy ArgentinaChemel, James L Cpa RENEWAL10/18/2026
Elwin SharvillMisaki I Malet SpainChemel, James L Cpa PROPOSAL10/15/2026
Elwin SharvillAntonio E Rim SpainPrinting Dimensions NEW10/15/2026
Total Customers:3
Ioni Bowcher
Ioni BowcherFaith P Saylors GermanyChapman, Ross E Esq QUALIFIED10/20/2026
Ioni BowcherIzzy V Malet CanadaChapman, Ross E Esq QUALIFIED11/07/2026
Ioni BowcherDarci Y Paprocki FranceCommercial Press NEW11/10/2026
Ioni BowcherMaisha K Shinko GermanyBuckley Miller Wright PROPOSAL10/25/2026
Total Customers:4
Ivan Magalhaes
Ivan MagalhaesStacey X Caudy ArgentinaRangoni Of Florence UNQUALIFIED10/15/2026
Ivan MagalhaesDarci O Malet BrazilBuckley Miller Wright PROPOSAL10/29/2026
Total Customers:2
Onyama Limba
Onyama LimbaOctavia N Perin GermanyTruhlar And Truhlar Attys PROPOSAL11/04/2026
Onyama LimbaJames Y Slusarski JapanFeiner Bros RENEWAL10/21/2026
Onyama LimbaGreenwood E Bolognia RussiaChanay, Jeffrey A Esq NEGOTIATION11/07/2026
Onyama LimbaRicardo G Garufi AustraliaRousseaux, Michael Esq NEW10/27/2026
Onyama LimbaJones H Iturbide RussiaRangoni Of Florence PROPOSAL11/01/2026
Onyama LimbaDarci Y Albares BrazilFeltz Printing Service NEGOTIATION10/31/2026
Onyama LimbaIvar F Schemmer United KingdomKing, Christopher A Esq NEW10/23/2026
Onyama LimbaFrancesco P Ostrosky United KingdomBuckley Miller Wright UNQUALIFIED10/14/2026
Total Customers:8
Stephen Shaw
Xuxue Feng
Xuxue FengMaisha P Vocelka FranceChemel, James L Cpa PROPOSAL11/08/2026
Xuxue FengJames X Caldarera CanadaBuckley Miller Wright PROPOSAL10/26/2026
Xuxue FengLeon C Ostrosky SpainBenton, John B Jr PROPOSAL11/02/2026
Xuxue FengDeepesh M Iturbide CanadaRousseaux, Michael Esq QUALIFIED11/02/2026
Xuxue FengOctavia D Malet GermanyFeltz Printing Service RENEWAL10/24/2026
Total Customers:5
Summary Row
RepresentativeNameCountryCompany
Amy ElsnerJulie Y Dilliard CanadaDorl, James J Esq
Amy ElsnerMujtaba S Maclead JapanChanay, Jeffrey A Esq
Amy ElsnerTony G Perin United KingdomFeiner Bros
Amy ElsnerClifford X Ferencz IndiaChanay, Jeffrey A Esq
Total Customers:4
Anna FaliMunro D Poquette IndiaFeiner Bros
Anna FaliJulie C Saylors GermanyMorlong Associates
Anna FaliMujtaba F Ostrosky ItalyFeltz Printing Service
Anna FaliKadeem C Morasca GermanyTruhlar And Truhlar Attys
Anna FaliArvin K Wieser SpainPrinting Dimensions
Total Customers:5
Asiya JavayantJones L Chui FranceTruhlar And Truhlar Attys
Asiya JavayantClaire A Saylors CanadaChapman, Ross E Esq
Asiya JavayantMaisha Q Inouye CanadaKing, Christopher A Esq
Asiya JavayantJeanfrancois N Maclead FranceRousseaux, Michael Esq
Asiya JavayantAdams Y Figeroa IndiaFeiner Bros
Asiya JavayantSalvatore P Foller United KingdomFeiner Bros
Asiya JavayantFaith J Bowley GermanyRousseaux, Michael Esq
Asiya JavayantJulie R Stenseth ItalyBuckley Miller Wright
Total Customers:8
Bernardo DominicMisaki J Ostrosky AustraliaChanay, Jeffrey A Esq
Bernardo DominicNicolas R Whobrey JapanBuckley Miller Wright
Bernardo DominicKaitlin H Whobrey JapanBenton, John B Jr
Bernardo DominicCosta W Bowley IndiaPrinting Dimensions
Bernardo DominicIzzy G Oldroyd AustraliaBuckley Miller Wright
Bernardo DominicJuan J Chui RussiaBenton, John B Jr
Bernardo DominicJeanfrancois O Amigon CanadaTruhlar And Truhlar Attys
Total Customers:7
Elwin SharvillSilvio H Darakjy ArgentinaChemel, James L Cpa
Elwin SharvillMisaki I Malet SpainChemel, James L Cpa
Elwin SharvillAntonio E Rim SpainPrinting Dimensions
Total Customers:3
Ioni BowcherFaith P Saylors GermanyChapman, Ross E Esq
Ioni BowcherIzzy V Malet CanadaChapman, Ross E Esq
Ioni BowcherDarci Y Paprocki FranceCommercial Press
Ioni BowcherMaisha K Shinko GermanyBuckley Miller Wright
Total Customers:4
Ivan MagalhaesStacey X Caudy ArgentinaRangoni Of Florence
Ivan MagalhaesDarci O Malet BrazilBuckley Miller Wright
Total Customers:2
Onyama LimbaOctavia N Perin GermanyTruhlar And Truhlar Attys
Onyama LimbaJames Y Slusarski JapanFeiner Bros
Onyama LimbaGreenwood E Bolognia RussiaChanay, Jeffrey A Esq
Onyama LimbaRicardo G Garufi AustraliaRousseaux, Michael Esq
Onyama LimbaJones H Iturbide RussiaRangoni Of Florence
Onyama LimbaDarci Y Albares BrazilFeltz Printing Service
Onyama LimbaIvar F Schemmer United KingdomKing, Christopher A Esq
Onyama LimbaFrancesco P Ostrosky United KingdomBuckley Miller Wright
Total Customers:8
Stephen ShawRicardo X Stenseth IndiaDorl, James J Esq
Stephen ShawJeanfrancois X Iturbide IndiaBuckley Miller Wright
Stephen ShawSalvatore B Caudy BrazilKing, Christopher A Esq
Stephen ShawFrancesco J Rim AustraliaTruhlar And Truhlar Attys
Total Customers:4
Xuxue FengMaisha P Vocelka FranceChemel, James L Cpa
Xuxue FengJames X Caldarera CanadaBuckley Miller Wright
Xuxue FengLeon C Ostrosky SpainBenton, John B Jr
Xuxue FengDeepesh M Iturbide CanadaRousseaux, Michael Esq
Xuxue FengOctavia D Malet GermanyFeltz Printing Service
Total Customers:5
Rowspan
RepresentativeNameCountryCompanyStatusDate
Amy ElsnerJulie Y Dilliard CanadaDorl, James J Esq RENEWAL10/31/2026
Amy ElsnerMujtaba S Maclead JapanChanay, Jeffrey A Esq NEGOTIATION11/09/2026
Amy ElsnerTony G Perin United KingdomFeiner Bros NEGOTIATION11/06/2026
Amy ElsnerClifford X Ferencz IndiaChanay, Jeffrey A Esq PROPOSAL10/18/2026
Anna FaliMunro D Poquette IndiaFeiner Bros QUALIFIED11/07/2026
Anna FaliJulie C Saylors GermanyMorlong Associates NEW10/24/2026
Anna FaliMujtaba F Ostrosky ItalyFeltz Printing Service RENEWAL11/05/2026
Anna FaliKadeem C Morasca GermanyTruhlar And Truhlar Attys UNQUALIFIED10/20/2026
Anna FaliArvin K Wieser SpainPrinting Dimensions NEW10/27/2026
Asiya JavayantJones L Chui FranceTruhlar And Truhlar Attys RENEWAL11/09/2026
Asiya JavayantClaire A Saylors CanadaChapman, Ross E Esq NEW10/29/2026
Asiya JavayantMaisha Q Inouye CanadaKing, Christopher A Esq NEGOTIATION10/31/2026
Asiya JavayantJeanfrancois N Maclead FranceRousseaux, Michael Esq NEW11/06/2026
Asiya JavayantAdams Y Figeroa IndiaFeiner Bros RENEWAL10/31/2026
Asiya JavayantSalvatore P Foller United KingdomFeiner Bros RENEWAL10/22/2026
Asiya JavayantFaith J Bowley GermanyRousseaux, Michael Esq QUALIFIED10/15/2026
Asiya JavayantJulie R Stenseth ItalyBuckley Miller Wright QUALIFIED10/25/2026
Bernardo DominicMisaki J Ostrosky AustraliaChanay, Jeffrey A Esq UNQUALIFIED10/28/2026
Bernardo DominicNicolas R Whobrey JapanBuckley Miller Wright NEGOTIATION10/19/2026
Bernardo DominicKaitlin H Whobrey JapanBenton, John B Jr RENEWAL11/03/2026
Bernardo DominicCosta W Bowley IndiaPrinting Dimensions RENEWAL10/25/2026
Bernardo DominicIzzy G Oldroyd AustraliaBuckley Miller Wright QUALIFIED10/18/2026
Bernardo DominicJuan J Chui RussiaBenton, John B Jr NEGOTIATION10/31/2026
Bernardo DominicJeanfrancois O Amigon CanadaTruhlar And Truhlar Attys UNQUALIFIED11/03/2026
Elwin SharvillSilvio H Darakjy ArgentinaChemel, James L Cpa RENEWAL10/18/2026
Elwin SharvillMisaki I Malet SpainChemel, James L Cpa PROPOSAL10/15/2026
Elwin SharvillAntonio E Rim SpainPrinting Dimensions NEW10/15/2026
Ioni BowcherFaith P Saylors GermanyChapman, Ross E Esq QUALIFIED10/20/2026
Ioni BowcherIzzy V Malet CanadaChapman, Ross E Esq QUALIFIED11/07/2026
Ioni BowcherDarci Y Paprocki FranceCommercial Press NEW11/10/2026
Ioni BowcherMaisha K Shinko GermanyBuckley Miller Wright PROPOSAL10/25/2026
Ivan MagalhaesStacey X Caudy ArgentinaRangoni Of Florence UNQUALIFIED10/15/2026
Ivan MagalhaesDarci O Malet BrazilBuckley Miller Wright PROPOSAL10/29/2026
Onyama LimbaOctavia N Perin GermanyTruhlar And Truhlar Attys PROPOSAL11/04/2026
Onyama LimbaJames Y Slusarski JapanFeiner Bros RENEWAL10/21/2026
Onyama LimbaGreenwood E Bolognia RussiaChanay, Jeffrey A Esq NEGOTIATION11/07/2026
Onyama LimbaRicardo G Garufi AustraliaRousseaux, Michael Esq NEW10/27/2026
Onyama LimbaJones H Iturbide RussiaRangoni Of Florence PROPOSAL11/01/2026
Onyama LimbaDarci Y Albares BrazilFeltz Printing Service NEGOTIATION10/31/2026
Onyama LimbaIvar F Schemmer United KingdomKing, Christopher A Esq NEW10/23/2026
Onyama LimbaFrancesco P Ostrosky United KingdomBuckley Miller Wright UNQUALIFIED10/14/2026
Stephen ShawRicardo X Stenseth IndiaDorl, James J Esq UNQUALIFIED10/27/2026
Stephen ShawJeanfrancois X Iturbide IndiaBuckley Miller Wright UNQUALIFIED10/28/2026
Stephen ShawSalvatore B Caudy BrazilKing, Christopher A Esq NEW11/04/2026
Stephen ShawFrancesco J Rim AustraliaTruhlar And Truhlar Attys UNQUALIFIED11/01/2026
Xuxue FengMaisha P Vocelka FranceChemel, James L Cpa PROPOSAL11/08/2026
Xuxue FengJames X Caldarera CanadaBuckley Miller Wright PROPOSAL10/26/2026
Xuxue FengLeon C Ostrosky SpainBenton, John B Jr PROPOSAL11/02/2026
Xuxue FengDeepesh M Iturbide CanadaRousseaux, Michael Esq QUALIFIED11/02/2026
Xuxue FengOctavia D Malet GermanyFeltz Printing Service RENEWAL10/24/2026

Usage


<div class="card">
    <h5 class="first">Header Row</h5>
    <h:form>
        <p:dataTable var="customer" value="#{dtRowGroupView.customers}">
            <p:headerRow field="representative.name"
                         expandable="true" 
                         expanded="#{customer.representative.name != 'Stephen Shaw'}">
                
                <p:column colspan="6">
                    <div class="inline-flex align-items-center" style="vertical-align: middle">
                        <p:graphicImage name="images/avatar/#{customer.representative.image}" library="demo" width="32" style="vertical-align: middle"/>
                        <h:outputText styleClass="ml-2" value="#{customer.representative.name}"/>
                    </div>
                </p:column>
            </p:headerRow>

            <p:column headerText="Representative">
                <h:outputText value="#{customer.representative.name}" />
            </p:column>

            <p:column headerText="Name">
                <h:outputText value="#{customer.name}" />
            </p:column>

            <p:column headerText="Country">
                <span class="flag flag-#{customer.country.code}" style="width: 30px; height: 20px"/>
                <h:outputText style="vertical-align: middle; margin-left: .5rem" value="#{customer.country}"/>
            </p:column>

            <p:column headerText="Company">
                <h:outputText value="#{customer.company}" />
            </p:column>

            <p:column headerText="Status">
                <span class="customer-badge status-#{customer.status.name().toLowerCase()}">#{customer.status}</span>
            </p:column>

            <p:column headerText="Date">
                <h:outputText value="#{customer.date}">
                    <f:convertDateTime pattern="MM/dd/yyyy" type="localDate"/>
                </h:outputText>
            </p:column>

            <p:summaryRow>
                <p:column colspan="5" style="text-align:right">
                    <h:outputText value="Total Customers:"/>
                </p:column>
                <p:column>
                    <h:outputText value="#{dtRowGroupView.getTotalCount(customer.representative.name)}"/>
                </p:column>
            </p:summaryRow>
        </p:dataTable>
    </h:form>
</div>

<div class="card">
    <h5>Summary Row</h5>
    <h:form>
        <p:dataTable var="customer" value="#{dtRowGroupView.customers}">
            <p:column headerText="Representative" sortBy="#{customer.representative.name}" sortOrder="asc">
                <h:outputText value="#{customer.representative.name}" />
            </p:column>

            <p:column headerText="Name">
                <h:outputText value="#{customer.name}" />
            </p:column>

            <p:column headerText="Country">
                <span class="flag flag-#{customer.country.code}" style="width: 30px; height: 20px"/>
                <h:outputText style="vertical-align: middle; margin-left: .5rem" value="#{customer.country}"/>
            </p:column>

            <p:column headerText="Company">
                <h:outputText value="#{customer.company}" />
            </p:column>

            <!-- no headerRow, the summaryRow defines the group itself -->
            <p:summaryRow field="representative.name">
                <p:column colspan="3" style="text-align:right">
                    <h:outputText value="Total Customers:"/>
                </p:column>
                <p:column>
                    <h:outputText value="#{dtRowGroupView.getTotalCount(customer.representative.name)}"/>
                </p:column>
            </p:summaryRow>
        </p:dataTable>
    </h:form>
</div>

<div class="card">
    <h5>Rowspan</h5>
    <h:form>
        <p:dataTable var="customer" value="#{dtRowGroupView.customers}">
            <p:column  headerText="Representative" groupRow="true">
                <p:graphicImage name="images/avatar/#{customer.representative.image}" library="demo"
                                width="32" style="vertical-align: middle"/>
                <h:outputText style="vertical-align: middle; margin-left: .5rem"
                              value="#{customer.representative.name}"/>
            </p:column>

            <p:column headerText="Name">
                <h:outputText value="#{customer.name}" />
            </p:column>

            <p:column headerText="Country">
                <span class="flag flag-#{customer.country.code}" style="width: 30px; height: 20px"/>
                <h:outputText style="vertical-align: middle; margin-left: .5rem" value="#{customer.country}"/>
            </p:column>

            <p:column headerText="Company">
                <h:outputText value="#{customer.company}" />
            </p:column>

            <p:column headerText="Status">
                <span class="customer-badge status-#{customer.status.name().toLowerCase()}">#{customer.status}</span>
            </p:column>

            <p:column headerText="Date">
                <h:outputText value="#{customer.date}">
                    <f:convertDateTime pattern="MM/dd/yyyy" type="localDate"/>
                </h:outputText>
            </p:column>
        </p:dataTable>
    </h:form>
</div>