I want uses a tree in p:accordionPanel,but cannot work fine

UI Components for JSF
Post Reply
david.che
Posts: 5
Joined: 05 Mar 2010, 11:14

11 Jun 2010, 05:38

I want uses a tree in p:accordionPanel,but cannot work fine ,when click the treenode,the tree node cannot Collapse or Expand,

Code: Select all


<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui">
<h:head>
</h:head>
<!--  panel menu -->
<h:form>

    any number of tabs
    <p:accordionPanel>

        <p:tab title="#{bundle.log_manager}">
            <ui:include src="./tree.xhtml"/>
        </p:tab>
        ... any number of tabs
    </p:accordionPanel>
</h:form>
</html>

tree.xhtml

Code: Select all


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">

        <p:tree value="#{documentsController.root}" dynamic="true" var="doc">
            <p:treeNode>
                <h:outputText value="#{doc}"/>
            </p:treeNode>

            <p:treeNode type="document" >
                <!--<h:outputText value="#{doc}" styleClass="documentStyle"/>-->
                <p:commandLink value="#{doc}" styleClass="documentStyle"/>
            </p:treeNode>

            <p:treeNode type="picture"  >
                <h:outputText value="#{doc}" styleClass="nodeContent"/>
            </p:treeNode>

            <p:treeNode type="mp3"  >
                <h:outputText value="#{doc}" styleClass="nodeContent"/>
            </p:treeNode>
        </p:tree>

</html>


callahan
Posts: 768
Joined: 27 May 2010, 22:52

11 Jun 2010, 10:11

It's probably the <p:commandLink> in your second treeNode that's causing the problem. See http://primefaces.prime.com.tr/forum/vi ... f=3&t=1872 for more info.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 49 guests