I need to make thing like explorer in windows, tree in left side and datatable in right. How can i show list of treenodes in datatable? I try this:
Code: Select all
<p:layoutUnit id="left" position="west" size="300" resizable="true" minSize="200">
<p:tree id="tree"
value="#{treeBean.root}"
var="node"
selectionMode="single"
selection="#{treeBean.selectedNode}"
dynamic="true"
cache="true">
<p:treeNode>
<h:outputText value="#{node}" />
</p:treeNode>
</p:tree>
</p:tab>
</p:layoutUnit>
<p:layoutUnit id="center" position="center">
<p:dataTable id="table"
var="ListChilds"
value="#{treeBean.selectedNode}"
dynamic="true"
resizableColumns="true"
paginator="true"
rows="10"
paginatorTemplate=" {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown} "
rowsPerPageTemplate="5,10,15"
>
<p:column style="width:30%">
<f:facet name="header">
<h:outputText value="File name" />
</f:facet>
<h:outputText value="#{ListChilds.listFiles}" />
</p:column>
</p:dataTable>
</h:panelGrid>
</p:layoutUnit>