6 Replies Latest reply on Feb 19, 2009 9:44 AM by Lotfi Mellouk

    [rich:Tree] convert data Object!

    Lotfi Mellouk Master

      Hi all,

      Im using Tree like default usage on the demo, I'd like to set an object on tree data parameter in order of String.

        • 1. Re: [rich:Tree] convert data Object!
          Nick Belaevski Master

          Hello,

          Can you please clarify what particular demo you mean? There are several of them there...

          • 2. Re: [rich:Tree] convert data Object!
            Lotfi Mellouk Master

             

            "nbelaevski" wrote:
            Hello,

            Can you please clarify what particular demo you mean? There are several of them there...


            I meant the default Tree model on Richfaces live demo [url]http://livedemo.exadel.com/richfaces-demo/richfaces/tree.jsf?tab=model&cid=913147/url]

            • 3. Re: [rich:Tree] convert data Object!
              Nick Belaevski Master

              Sorry, but still not clear enough for me. Please post page code illustrating what you are trying to achieve.

              • 4. Re: [rich:Tree] convert data Object!
                Lotfi Mellouk Master

                 

                "nbelaevski" wrote:
                Sorry, but still not clear enough for me. Please post page code illustrating what you are trying to achieve.


                I tested Tree using TreeNodeImpl without implementing TreeNode,

                <rich:tree style="width:400px" nodeSelectListener="#{bean.processSelection}"
                reRender="selectedNode" ajaxSubmitSelection="true"
                value="#{bean.treeNode}" var="item" rendered="false">
                </rich:tree>
                


                using default TreeNodeImpl, it seems impossible to set object on treeNode data,
                I have implemented TreeNode as explained on Library example, so I can get a node as object.
                just want to know what type of component can we put inside rich:treeNode ??

                <rich:treeNode type="user" icon="./images/singer.gif">
                <h:outputText value="#{item.firstname} #{item.firstname}" />
                /rich:treeNode>
                


                can we a complexe component instead of sample outputText?

                <rich:treeNode type="user" icon="./images/singer.gif">
                <rich:dataTable ../> is correct???
                /rich:treeNode>
                


                • 5. Re: [rich:Tree] convert data Object!
                  Nick Belaevski Master

                  Thank you, it's much clear now!

                  1. You can use treeNodeVar to operate with instance of TreeNode

                  2. Frankly speaking, I'm not 100% sure about correct functioning of nested data table (we have one issue in JIRA about nested trees and they're based on the same code), but it is allowed and you can use either dataTable or another component you need.

                  • 6. Re: [rich:Tree] convert data Object!
                    Lotfi Mellouk Master

                     

                    "nbelaevski" wrote:
                    Thank you, it's much clear now!

                    1. You can use treeNodeVar to operate with instance of TreeNode

                    2. Frankly speaking, I'm not 100% sure about correct functioning of nested data table (we have one issue in JIRA about nested trees and they're based on the same code), but it is allowed and you can use either dataTable or another component you need.


                    Thanks a lot

                    best regards!