2 Replies Latest reply on Jun 7, 2010 7:06 AM by vestnik

    Rich Tree eats divs.

    vestnik

      Hello

       

      I have really strange issue with rich tree. I have one root element and several child element inside it. Root element is open and child elements are closed by default. If the last element from the opened children have no child elements all html <div> elements after the <rich:tree> in facelet source become to be children of <td> element which contains last tree node. It looks like those elements are rendered inside this table cell by the facelet servlet itself.

       

      If last visible element in my tree has children there is no such issue. And this issue appears only with the second level nodes of the tree.

       

      I'm using SEAM 2.2.0 GA and RichFaces which comes with this version of SEAM (I can't see where can I found information about RichFaces version it uses).

       

      Does anybody know how can I solve this issue? I'm ready to provide more information if needed just ask me.

       

      Here is my rich:tree template code:

       

      {code:xml}
      <rich:dragIndicator id="indicator"/>

      <rich:tree id="categoryTree" switchType="ajax"
                  ajaxSubmitSelection="true" reRender="controls,messages"
                  nodeSelectListener="#{categoryTreeActions.processSelection}"
                  stateAdvisor="#{categoryTreeModel}"
                  dropListener="#{categoryTreeActions.processDrop}" dragIndicator="indicator">
          <rich:recursiveTreeNodesAdaptor roots="#{categoryTreeModel.roots}" var="item" nodes="#{item.children}">
             <!-- Root node -->
             <rich:treeNode rendered="#{item.typeName == 'Root'}"
                            icon="#{a4jSkin.categoryTreeRootIcon}"
                            iconLeaf="#{a4jSkin.categoryTreeRootIcon}"
                            acceptedTypes="category">
                <h:outputText value="#{messages['edupro.categories.tree.topLevelNode']}"/>
             </rich:treeNode>

             <!-- Categories nodes (empty/with subcategories/with courses/containing both categories and courses) -->
             <rich:treeNode rendered="#{item.typeName == 'Category' and not item.hasCourses and not item.hasSubcategories}"
                            icon="#{a4jSkin.categoryTreeCategoryIcon}"
                            iconLeaf="#{a4jSkin.categoryTreeCategoryIcon}"
                            dragType="category"
                            acceptedTypes="category,course">
                <h:outputText value="#{item.title}"/>
             </rich:treeNode>

             <rich:treeNode rendered="#{item.typeName == 'Category' and not item.hasCourses and item.hasSubcategories}"
                            icon="#{a4jSkin.categoryTreeCategoryIcon}"
                            iconLeaf="#{a4jSkin.categoryTreeCategoryIcon}"
                            dragType="category"
                            acceptedTypes="category">
                <h:outputText value="#{item.title}"/>
             </rich:treeNode>

             <rich:treeNode rendered="#{item.typeName == 'Category' and item.hasCourses and not item.hasSubcategories}"
                            icon="#{a4jSkin.categoryTreeCategoryIcon}"
                            iconLeaf="#{a4jSkin.categoryTreeCategoryIcon}"
                            dragType="course"
                            acceptedTypes="category,course">
                <h:outputText value="#{item.title}"/>
             </rich:treeNode>

             <rich:treeNode rendered="#{item.typeName == 'Category'}"
                            icon="#{a4jSkin.categoryTreeCategoryIcon}"
                            iconLeaf="#{a4jSkin.categoryTreeCategoryIcon}"
                            dragType="course">
                <h:outputText value="#{item.title}"/>
             </rich:treeNode>

             <!-- Courses nodes (active/inactive) -->
             <rich:treeNode rendered="#{item.typeName == 'Course' and item.courseActive}"
                            icon="#{a4jSkin.categoryTreeCourseIcon}"
                            iconLeaf="#{a4jSkin.categoryTreeCourseIcon}"
                            dragType="course">
                <h:outputText value="#{item.title}"/>
             </rich:treeNode>

             <rich:treeNode rendered="#{item.typeName == 'Course' and not item.courseActive}"
                            icon="#{a4jSkin.categoryTreeCourseIcon}"
                            iconLeaf="#{a4jSkin.categoryTreeCourseIcon}"
                            dragType="course">
                <h:outputText value="#{item.title}" style="color:#{a4jSkin.inactiveTextColor}"/>
             </rich:treeNode>
          </rich:recursiveTreeNodesAdaptor>
      </rich:tree>
      {code}