TreeTable - Dynamic Columns Columns of TreeTable can be created dynamically using the p:columns component.
Document Viewer
NAMESIZETYPE
<h:form id="form">
    <h:panelGrid columns="3" style="margin:10px 0">
        <p:outputLabel for="template" value="Template:" style="font-weight:bold"/>
        <p:inputText id="template" value="#{ttColumnsView.columnTemplate}" size="50"/>
        <p:commandButton update="tt" actionListener="#{ttColumnsView.createDynamicColumns}" value="Update" process="@parent" icon="ui-icon-refresh" />
    </h:panelGrid>

    <p:treeTable id="tt" value="#{ttColumnsView.root}" var="document">
        <f:facet name="header">
            Document Viewer
        </f:facet>
        <p:columns value="#{ttColumnsView.columns}" var="column" headerText="#{column.header}">
            <h:outputText value="#{document[column.property]}" />
        </p:columns>
    </p:treeTable>
</h:form>
                
PrimeTek, Copyright © 2017
All rights reserved.
Running PrimeFaces-6.2-SNAPSHOT on Mojarra-2.3.2.