Datatable of tree node

UI Components for JSF
Post Reply
loright
Posts: 42
Joined: 10 Aug 2011, 09:55

06 Sep 2011, 08:07

Hello!
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>
But data table cannot display object treenode. I must translate treenode to another type? am i right?
Primefaces 3.4 + JBoss 6.1. Final

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 28 guests