5 Replies Latest reply: Nov 21, 2012 7:02 AM by 969837 RSS

    Build Tree from pl/sql

      I have pl/sql function returning table of inherited objects keys:

      function get_class_inheritors(p_cclassname varchar2) return sys_refcursor

      it returns className, inheritorClassName, InheritorCaption

      so I call it for some rootClassName, then iterate over it result and call function for result items and so on, until result has no rows.

      I need to recursevly build tree of inheritors and show it on page, interactively, when user selects new object from table

      1) how to build model of TreeModel?
      I can create Entity for it or generate it programaticaly, but I reealy do not understand the point to start :(

      In case of Entity I realy do not get how to build tree binding :( I cant select root for the tree

      2) where to put moddel building (backing bean or appModule)?
        • 1. Re: Build Tree from pl/sql
          Kamaal, Saif Kamaal
          You can create a VO from the pl/sql. Try that.
          • 2. Re: Build Tree from pl/sql
            yes i can, but how I will bind it to tree?
            • 3. Re: Build Tree from pl/sql
              Kamaal, Saif Kamaal
              Add the VO to an App module. Create a datacontrol for the app module. Now in you page whwn you drop the vo you will get the option
              • 4. Re: Build Tree from pl/sql
                Ok. (btw, I am using Avrom's Package API-based framework)

                1) I created Inheritors VO based on pl/sql function with binded variable
                2) I created ViewLink from Class VO to Inheritors VO

                it works GREAT, it worked like this few days already :), I can get inheritors list fine. but it just one level, I need to get in 2-3 levels down recursevly, displaying it like a tree

                when I try to bind a tree I get this: screen

                And do not know what to do next.
                • 5. Re: Build Tree from pl/sql
                  I will change my question a little bit.

                  I have pl/sql func: get_class_inheritors_tree(className)

                  Result is like this:
                  child1 parent     1
                  child2     parent     1
                  grandChild21      child2     2
                  grandChild22     child2     2
                  grandChild11     child1     2
                  grandChild12     child1     2

                  How can I display this using af:tree like this: