Tree - Basic Tree has two modes, in client mode all nodes are available at client side whereas in ajax mode only expanded nodes are available.

Client

Ajax

<h:form>
    <h3 style="margin-top:0">Client</h3>
    <p:tree value="#{treeBasicView.root}" var="node">
        <p:treeNode>
            <h:outputText value="#{node}" />
        </p:treeNode>
    </p:tree>

    <h3>Ajax</h3>
    <p:tree value="#{treeBasicView.root}" var="node" dynamic="true">
        <p:treeNode>
            <h:outputText value="#{node}" />
        </p:treeNode>
    </p:tree>
</h:form>
                
PrimeTek, Copyright © 2015
All rights reserved.
Running PrimeFaces-6.1-SNAPSHOT on Mojarra-2.2.8.