TreeTable - Events An ajax behavior callback is provided for each event such as expand, collapse, select and unselect.
Document Viewer
NameSizeType
<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>
                
PrimeTek, Copyright © 2017
All rights reserved.
Running PrimeFaces-6.2-SNAPSHOT on Mojarra-2.3.2.