TreeTable - Events

An ajax behavior callback is provided for each event such as expand, collapse, select and unselect.

Documentation
Document Viewer
NameSizeType
<style type="text/css">
    .ui-treetable table {
        table-layout: fixed
    }
</style>


<h:form id="form">
    <p:growl id="messages" showDetail="true" /> 
    
    <p:treeTable value="#{ttEventsView.root}" var="document" selectionMode="single" selection="#{ttEventsView.selectedNode}">
        <p:ajax event="expand" listener="#{ttEventsView.onNodeExpand}" update=":form:messages" />
        <p:ajax event="collapse" listener="#{ttEventsView.onNodeCollapse}" update=":form:messages" />
        <p:ajax event="select" listener="#{ttEventsView.onNodeSelect}" update=":form:messages" />
        <p:ajax event="unselect" listener="#{ttEventsView.onNodeUnselect}" update=":form:messages" />
            
        <f:facet name="header">
            Document Viewer
        </f:facet>
        <p:column headerText="Name">
            <h:outputText value="#{document.name}" />
        </p:column>
        <p:column headerText="Size">
            <h:outputText value="#{document.size}" />
        </p:column>
        <p:column headerText="Type">
            <h:outputText value="#{document.type}" />
        </p:column>
    </p:treeTable>
</h:form>

FREE THEMES

Built-in component themes created by the PrimeFaces Theme Designer.

nova-light Nova-Light
nova-dark Nova-Dark
nova-colored Nova-Colored
luna-blue Luna-Blue
luna-amber Luna-Amber
luna-green Luna-Green
luna-pink Luna-Pink
omega Omega

PREMIUM TEMPLATES

Create awesome applications in no time using the premium templates and impress your users.