4 Replies Latest reply on May 16, 2013 5:59 PM by skjskjskj

    RichFaces 4 expand whole tree

    kwutzke

      Hello,

       

      I would like to display the whole tree expanded when the page is loaded the first time. Edit: It would be okay to have some functionality to programmatically expand the whole tree, e.g. via button or similar.

       

      I found this for RichFaces 3:

       

      http://community.jboss.org/message/30212

       

      ...but how is it done in RichFaces 4? There doesn't seem to be an adviseNodeOpened attribute for RichFaces 4 rich:tree.

       

      How is it done?

       

      Karsten

        • 1. Re: RichFaces 4 expand whole tree
          kwutzke

          It would be nice to find out how to expand the whole tree at all. The first load is not as important.

           

          Can anybody help?

           

          Karsten

          • 2. Re: RichFaces 4 expand whole tree
            chelachen

            try <rich:treeNode expanded="#{true}">

            • 3. Re: RichFaces 4 expand whole tree
              strannik

              Hi, Chelachen.

               

              Unfortunately your suggestion doesn't work for me. Any new ideas?

              • 4. Re: RichFaces 4 expand whole tree

                <rich:tree var="dir" toggleType="client" >

                    <rich:treeModelRecursiveAdaptor roots="${contentService.rootDirectories}" nodes="${dir.children}">

                        <rich:treeNode expanded="${not empty dir.children}"

                            iconLeaf="${dir.icon}" iconExpanded="${dir.icon}" iconCollapsed="${dir.icon}">

                            <h:outputText value="${dir.class.simpleName} - " />

                            <h:outputLink value="/admin/edit${dir.class.simpleName}.xhtml?id=${dir.id}">

                                <h:outputText value="${dir.name}" />

                            </h:outputLink>

                            <rich:treeModelAdaptor nodes="${dir.children}" />

                        </rich:treeNode>

                    </rich:treeModelRecursiveAdaptor>

                </rich:tree>