3 Replies Latest reply on Nov 10, 2008 5:51 AM by ilya_shaikovsky

    Forum Comments Tree implementation using RichFaces

    zeppelinux

      Hello All,

      I'm going to implement the subject and thinking about using the rich:tree component.
      I did not used it before in any project but it looks good and promising...
      Several questions:

      Is it good to use it for rendering pannels as leaves?
      Is it possible to disable the mouseover and mouse click events?

      What component will you use for Comments if rich:tree is not an option?

        • 1. Re: Forum Comments Tree implementation using RichFaces
          nbelaevski

          Try this code:

          <style type="text/css">
           .rich-tree-node-highlighted {
           color: #{a4jSkin.generalTextColor};
           text-decoration: none;
           }
          
           .rich-tree-node-selected {
           border-style: none;
           padding: 1px 4px;
           }
           </style>
          
           <h:form id="form">
           <rich:tree id="tree" switchType="ajax" value="#{dataService.rootNode}" var="item"
           treeNodeVar="treeNode" nodeFace="#{treeNode.leaf ? 'leaf' : 'node'}" onselected="return false;" preserveModel="none">
           <rich:treeNode id="node" type="node">
           <h:outputText value="#{item} #{testBean.timeString}" />
           </rich:treeNode>
           <rich:treeNode id="leaf" type="leaf">
           <rich:panel header="Panel">
           <h:outputText value="#{item} #{testBean.timeString}" />
           </rich:panel>
           </rich:treeNode>
           </rich:tree>
           </h:form>
          



          • 2. Re: Forum Comments Tree implementation using RichFaces
            zeppelinux

            It works, Thanks!

            When some new leaf added to the node and the parent node had no children before it remains collapsed, so only icon is update (showing that it has collapsed children now).

            Is there any way to force it to be expanded just after the first child added?

            • 3. Re: Forum Comments Tree implementation using RichFaces
              ilya_shaikovsky

              you could bind your tree and use queueNodeExpand(TreeRowKey rowKey) method.