use p:Tree for navigation

UI Components for JSF
Post Reply
Posts: 45
Joined: 16 Oct 2010, 16:17

17 Dec 2010, 12:59

I was trying to figure out how I would use p:tree to handle navigation. Basically, I wan't to use the tree as a menu in left side on my page. I was trying to use something like this in my code but I get an error. The data for the p:tree is populated in treeMenuBean (JSF Managed Session Bean).

Code: Select all

    <p:tree value="#{treeMenuBean.root}" var="node">
            <h:outputLink value="#{}">
                <h:outputLabel value="node"/>
Here is the error I get

Code: Select all

/public/treeMenu.xhtml @6,48 value="#{}": The class 'java.lang.String' does not have the property 'data'.
I am setting node.setData("/myPage.xhtml") in the treeMenuBean, but unable to retrieve it in the xhtml page in p:treeNode as a property of node variable.
If anyone has sucessfully used the p:Tree with outputLink, please post the example code.


Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 13 guests