• 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

TreeTable Basic

Field property is a shorthand to define sort, filter and display properties of a column.

TreeTable Tag Documentation

TreeTable is is used for displaying hierarchical data in tabular format.

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.
cellEditMode String false eager Defines the cell edit behavior, valid values are "eager" and "lazy".
cellSeparator String false Separator text to use in output mode of editable cells with multiple components.
cloneOnFilter boolean false false Defines if nodes should be cloned on filter via Cloneable interface or Copy-Constructor (CustomNode(CustomNode original) or CustomNode(String type, Object data, TreeNode parent)). Normally the filtered nodes are new instanceof of DefaultTreeNode.
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.
disabledTextSelection boolean false true Disables text selection on row click.
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.
expandMode String false children Updates children only when set to "children" or the node itself with children when set to "self" on node expand.
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).
filterPrune String false none Controls pruning during filtering. "none" keeps children of matching nodes; "descendants" prunes non-matching children unless they or their descendants match.
filteredValue TreeNode false Node to keep the filtered nodes if filtering is enabled.
first int false 0 Index of the first data to display.
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.
liveResize boolean false false Columns are resized live in this mode without using a resize helper.
multiViewState boolean false false Whether to keep component state across views.
nativeElements boolean false false In native mode, treetable uses native checkboxes.
nodeVar String false Name of the request-scoped variable that'll be used to refer current treenode using EL.
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.
propagateSelectionDown boolean false true Defines downwards selection propagation for checkbox mode.
propagateSelectionUp boolean false true Defines upwards selection propagation for checkbox mode.
required boolean false false Marks component as required.
requiredMessage String false
resizableColumns boolean false false Defines if columns can be resized or not.
resizeMode String false fit Defines the resize behavior, valid values are "fit" and expand.
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. 0 means 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.
scrollWidth String false Width for scrollable data.
scrollable boolean false false Makes data scrollable with fixed header.
selection Object false TreeNode array to reference the selections.
selectionMode String false Defines the selectionMode, valid values are "single", "multiple" and "checkbox".
showGridlines boolean false false When enables, cell borders are displayed.
showUnselectableCheckbox boolean false false Defines if in checkbox selection mode, a readonly checkbox should be displayed for an unselectable node.
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.
style String false Inline style of the component.
styleClass String false Style class of the component.
tableStyle String false Inline style of the table element.
tableStyleClass String false Style class of the table element.
value TreeNode false Value of the component.
var String false Name of the request-scoped variable that'll be used to refer each treenode data during rendering.
Loading...
Tag DocumentationNew DocumentationNew Documentation JSDoc Basic Size Gridlines Selection Events Field ContextMenu Scroll Resize Sort Filter Columns Responsive Edit Paginator MultiViewState DisplayPriority
Document Viewer
NameSizeTypeActions

Usage


<div class="card">
    <h:form id="form">
        <p:treeTable value="#{ttBasicView.root}" var="document">
            <f:facet name="header">
                Document Viewer
            </f:facet>
            <p:column field="name" />
            <p:column field="size" />
            <p:column field="type" />
            <p:column style="width:3rem" ariaHeaderText="Actions">
                <p:commandButton update=":form:documentPanel" oncomplete="PF('documentDialog').show()"
                               title="View Detail" icon="pi pi-search">
                    <f:setPropertyActionListener value="#{document}" target="#{ttBasicView.selectedDocument}"/>
                </p:commandButton>
            </p:column>
        </p:treeTable>

        <p:dialog id="dialog" header="Document Detail" showEffect="fade" widgetVar="documentDialog" modal="true" resizable="false">
            <p:outputPanel id="documentPanel">
                <h:panelGrid columns="2" cellpadding="7" rendered="#{not empty ttBasicView.selectedDocument}">
                    <h:outputLabel for="name" value="Name" styleClass="text-secondary" />
                    <h:outputText id="name" value="#{ttBasicView.selectedDocument.name}" />

                    <h:outputLabel for="size" value="Size" styleClass="text-secondary" />
                    <h:outputText id="size" value="#{ttBasicView.selectedDocument.size}" />

                    <h:outputLabel for="type" value="Type" styleClass="text-secondary" />
                    <h:outputText id="type" value="#{ttBasicView.selectedDocument.type}" />
                </h:panelGrid>
            </p:outputPanel>
        </p:dialog>
    </h:form>
</div>