Hierarchy tree

Hi all

I created EO, VO of Department table and association was created, and viewlink between DEPT_ID and DEPT_PARENT.

[code]

In DB:

CREATE THE DEPARTMENT TABLE

(

DEPT_ID NUMBER (10) NOT NULL,

DEPT_NAME VARCHAR2 (100),

DEPT_PARENT NUMBER (10),

DEPT_TYPE NUMBER (1)

);

ALTER TABLE ADD DEPARTMENT)

CONSTRAINT PK_DEPARTMENT

PRIMARY KEY (DEPT_ID, DEPT_TYPE));

ALTER TABLE ADD DEPARTMENT)

CONSTRAINT FK_DEPARTMENT

FOREIGN KEY (DEPT_PARENT, DEPT_TYPE)

DEPARTMENT (DEPT_ID, DEPT_TYPE) REFERENCES);

Insert in the DEPARTMENT

(DEPT_ID, DEPT_NAME, DEPT_PARENT, DEPT_TYPE)

Values

(1, "mainDepartment", null, 1);

Insert in the DEPARTMENT

(DEPT_ID, DEPT_NAME, DEPT_PARENT, DEPT_TYPE)

Values

(2, 'childDepartment1', 1, 1);

Insert in the DEPARTMENT

(DEPT_ID, DEPT_NAME, DEPT_PARENT, DEPT_TYPE)

Values

(3, 'childDepartment1', 1, 1);

Insert in the DEPARTMENT

(DEPT_ID, DEPT_NAME, DEPT_PARENT, DEPT_TYPE)

Values

(4, "childDepartment2", 2, 1);

Insert in the DEPARTMENT

(DEPT_ID, DEPT_NAME, DEPT_PARENT, DEPT_TYPE)

Values

(5, "childDepartment2", 2, 1);

Insert in the DEPARTMENT

(DEPT_ID, DEPT_NAME, DEPT_PARENT, DEPT_TYPE)

Values

(6, 'childDepartment2', 2, 1);

Insert in the DEPARTMENT

(DEPT_ID, DEPT_NAME, DEPT_PARENT, DEPT_TYPE)

Values

(7, 'childDepartment3', 3, 1);

Insert in the DEPARTMENT

(DEPT_ID, DEPT_NAME, DEPT_PARENT, DEPT_TYPE)

Values

(8, 'childDepartment7', 7, 1);

Insert in the DEPARTMENT

(DEPT_ID, DEPT_NAME, DEPT_PARENT, DEPT_TYPE)

Values

(9, 'mainDepartment2', null, 1);

Insert in the DEPARTMENT

(DEPT_ID, DEPT_NAME, DEPT_PARENT, DEPT_TYPE)

Values

(10, 'childDepartment9', 9, 1);

SQL > select * from the Department;

DEPT_ID, DEPT_NAME DEPT_PARENT DEPT_TYPE

------- ---------------- -----------    ---------

1 mainDepartment 1

2 1 1 childDepartment1

3 1 1 childDepartment1

4-2-1 childDepartment2

5 1 2 childDepartment2

6 2 1 childDepartment2

7-1-3 childDepartment3

8 7 1 childDepartment7

9 mainDepartment2 1

10 9 1 childDepartment9

[/ code]

I want tree represent Department Vo view all Department with all the Department of the child to Mypage.jspx.

and display the data based on the tree node - < af:tree > form ADF - < af:form > and the same page.

JDeveloper 12 c

Thanks in advance.

Check the 32 sample # creating a table tree of a single object View and access selected row 8http://www.oracle.com/technetwork/developer-tools/adf/learnmore/32-tree-table-from-single-vo-169174.pdf) or http://www.oracle.com/technetwork/developer-tools/adf/learnmore/sept2011-otn-harvest-508189.pdf

  • Synchronize the edit form with self-reference VO on the Board of the tree"

Timo

Tags: Java

Similar Questions

  • The hierarchy tree tutorial

    Hello dear,

    Please someone help me or share a link to the development of the hierarchy tree on a form.

    I need the following specifications in development.

    that populate database table.
    Add a node that will be recorded in table
    remove a node that erases the precise recording of table
    update a node that update the database table.


    I'll be very thank you all in advance.

    Kind regards

    Zafar Iqbal

    Hello

    It is a starting point


    François

  • Fill the table of the hierarchy tree of XML data

    Hi experts

    I have an XML file and I want to create a hierarchy tree in a single table.
    Say the following XML:

    < Note >
    < to > < /pour > Mary
    < from > John < / from >
    < title > call < / section >
    < body > don't forget me this weekend < / body >
    < / note >

    Expected to generate these documents:

    TAG ID PARENT_ID VALUE
    Note 1 null null
    2 1 Marie
    3 1 John
    4 1 position of reminder
    5 1 body remember me this weekend

    How can I achieve this?

    Thanks in advance
    Oscar

    Hi Oscar,.

    These discussions should be of interest to you:

    {: identifier of the thread = 2210708}

    {: identifier of the thread = 2195072}

  • How to use record group to insert data into the hierarchy tree?

    Hello

    I had a hierarchical tree in my block and I want to use the record group to display
    in the hierarchy tree, call david_tree. He did work for the code I try below
    and I think it might be that the create_group_form_query was wrong? or miss an order?


    DECLARE
    htree;
    rg_data RECORDGROUP;
    v_ignore NUMBER;
    BEGIN
    htree: = Find_Item ('tree_block.david_tree');

    rg_data: = CREATE_GROUP_FROM_QUERY ('rg_bank',
    "select name, short_name".
    || "from css_banks");

    -Fill the record with data.

    v_ignore: = POPULATE_GROUP (rg_data);

    -Transfer the data from the record group to the hierarchical
    -tree and bring it to display.

    FTREE. SET_TREE_PROPERTY (htree, FTREE. (RECORD_GROUP, rg_data);

    END;


    Thank you


    David

    David,
    You get an error with your code? Looks like you took your example code help Forms. I don't really see a problem with the code, but the forms example gives an example of how create the record group used by the HTree so the Receiver General may be the cause of the problem. When I used the HTree, I used the FTREE. Procedure ADD_TREE_DATA to fill the tree. When I started working with HTree I created a wrapper package to simplify the process. You can watch how I work with the HTree in a demo that I published called: forms and how to: create a shape of the HIERARCHICAL tree.

    Hope this helps,
    Craig B-)

    If someone useful or appropriate, please mark accordingly.

  • Order by in the hierarchy tree

    HelloW All


    My request for the hierarchy tree is

    SELECT 1, LEVEL, name. ' ('| to_char (ID) |')    ', ", to_char (id)+.
    FROM py_emp+.
    CONNECT BY PRIOR id = start catagory_id with+.
    id in (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,+)
    * 21,22,23,24,25,26,27,28,29,30,31,32,33,34,35, *.
    * 36.37.38.39.40.41). *


    Its fine to work, but the hierarchy tree is not stopped by Id

    What can I do?

    2nd I want to start with the id in 1,2,3 do not enter from 1 to 1000 to continue automatically continue


    Concerning


    Wasim Ismail

    1. you can use

    BROTHERS AND SŒURS ORDER BY ID

    2. I do not understand this requirement

  • Colorful of the hierarchy tree

    Hello
    This is the first thread write. I searched your discussions for 'how to display the hierarchy tree in forms 10g with different colors and different fonts for different nodes weight '. But I found nothing.
    Looking forward hopefully to your answers.

    Hello

    Forms provides special not integrated to manage the coloring of a tree.
    The only way would be to do it through the Java code.

    François

  • Hierarchy tree Denorm full config

    What do we need to turn it on in order to see the specifications of trade that the Formulation of exit are related to, in the run-up to the release of formulation?

    When display us the FO tree, we see the spec of formulation and master card, but not the spec of trade to which it is bound. We have tried the config setting but without and success. Thank you

    David

    You are referencing denorm hierarchy, this service captures all hierarchies so that the data must be in the table.

    However, I assume you mean the tool navigator of the hierarchy since you mention a view of the actual production of formula.  Hierarchy browser shows that the specifications of the user to the bottom of the hierarchy.  Going up the hierarchy is non-deterministic as a single tree, for example, you can use the same formula in several finished products.    Where used report will show you the data that you want.  It will show you both multiple hierarchies. This report and others who profit from the denorm service will be available shortly after the holiday season.

    I hope this helps. Let me know if you have any questions.

    Kelly

  • Is there a way to the highest point in the hierarchy tree darker?

    It is the highest point that you see when a field in the tree is selected. The highest point is STILL very low, and the only way to see it is by looking at an angle.

    Hello

    This came before as the subject last year.

    You can change the color of items selected in the hierarchy. However it is a Windows setting in Control Panel.

    Have a look here: http://forums.adobe.com/message/2603870#2603870.

    Good luck

    Niall

  • Best way to display a report of the hierarchy tree to APEX 4.2

    I have a hierarchical query spans four levels over two tables.  The application works very well and also includes columns hierarchical sum (i.e. the parent displays the sum of all children) using functions.

    I wonder what is the best way to view these data for users?

    At the moment I think I would have a collection now my connection with the edition special 'show' column.  Then I would include HTML to define values correct show/hide and refresh the report when you click on a node.  In my view, this would probably work, but may not be the best way.

    I disassembled my request for necessary columns (no column of the sum) and the tree APEX regions work well for this.  Y at - it a plugin alternative jquery or anything that people with what will give me the directory structure 4.2 native while allowing me to display additional columns with links?

    If I need to provide more info let me know!

    LSDev wrote:

    I'm going to use today to test these ideas, and if they don't work I'll go with the classic report hack, I thought.

    AEC: I'll try the plugin and report back on the question if I can get the links to work.

    The plugin code is clear and simple. However, the links generated HTML text in the query as:

    ...
    '' || apex_escape.html(ename) || '' employee
    ...
    

    does not work out of the box as the plug-in is escaping in HTML output column values:

        -- Render all other columns
        FOR j IN 3 .. l_value_list.count
        LOOP
          sys.htp.p('' || sys.htf.escape_sc(l_value_list(j)(i)) || '');
        END LOOP;
    

    This can be changed to allow the links:

      -- Render all other columns
        FOR j IN 3 .. l_value_list.count
        LOOP
         IF l_value_list(j)(i) not like '' || l_value_list(j)(i) || '');
        END LOOP;
    
  • the hierarchy tree-shaped 10g

    Dear member.

    I am a beginner. and want to know about how to make hierarchical form
    I use suit developer 10g.



    Thank you


    Mustafa
    Lahore, pakistan

    Mustafa,

    the way you marked the node_id and parent_node_id in the two tables, it is at the level of the form. or that it's a bit confusing to me, I have to apply this form of ht to another schema.

    Yes, I create Federal Archives which fills the HT in the trigger once - new - form - Instance (WNFI). You can fill a HT of anywhere, but I use the WNFI to ensure that the tree is completed when the form is loaded.

    To add a node "Grandson" to your tree, you simply change the trigger WNFI and add a loop for these nodes. Use your data for example, the code in the WNFI might look like this (untested):

    DECLARE
       CURSOR c_comp IS
          SELEC T compcode, name
            FRO M company;
    
       CURSOR c_div (p_comp NUMBER) IS
          SELEC T div_id, div_name, dept_id
            FRO M s_div
          WHER E compcode = p_comp;
    
       CURSOR c_dept (IS
          SELEC T dept_id, dept_name
           FRO M s_dept
         WHER E dept_id = p_dept;
    
       n_level NUMBER := 1;
       n_row NUMBER := 1;
       rg_id  RECORDGROUP;
       node Ftree.Node;
    BEGIN
       Tree_Control.v_item_name := 'MY_TREE_DATA.MY_TREE';
       rg_id := Tree_Control.Create_RG;
    
       <>
       FOR r_comp IN c_comp LOOP
          -- Add Parent Company
          Tree_Control.ADD_RG_ROW(rg_id, ftree.collapsed_node, n_row,
                  n_level, r_comp.name, null, r_comp.compcode);
          n_row := n_row + 1;
          n_level := n_level + 1;
    
          -- Add any child Department records
          <>
          FOR r_div IN c_div(r_comp.compcode) LOOP
             Tree_Control.ADD_RG_ROW(rg_id, ftree.collapsed_node, n_row,
                  n_level, r_div.div_name, null, r_div.div_id);
             n_row := n_row+1;
    
             -- Now, add any Grandchildren
            <>
            FOR r_dept IN c_dept(r_div.dept_id) LOOP
               Tree_Control.ADD_RG_ROW(rg_id, ftree.collapsed_node, n_row,
                   n_level, r_dept.dept_name, null, r_dept.dept_id);
            END LOOP grandchild;
          END LOOP child;
       END LOOP parent;
    
       ftree.Add_Tree_Data(Tree_Control.v_item_name, ftree.ROOT_NODE,
                       ftree.PARENT_OFFSET, ftree.LAST_CHILD,
                       ftree.RECORD_GROUD, rg_id);
    END;
    

    You will still need to modify the Create_RG function in the Tree_Control package to support the changes described above, but this code example should help you get started.

    Craig...

  • Button gif icon not displayed but the icon of the hierarchy tree.

    Developer and oracle 10 g database

    I was working on windows Xp and oracle10g on button icon and HTree worked very well.
    After that, I installed windows 7 pro, in this icon of the window was not displayed.
    now, even once, I installed windows Xp and run my existing form there is a problem I m facing Htree menu does not display icon but button is displayed.

    I have set all parameters for the icon (gif file).
    define formsweb jar file
    recreated jar file *.gif files.
    Jar -cfv icons.jar *.gif
    copy jar file into java folder
    edit registry 
    edit regstry.dat
    
    it is record group
    
    
    SELECT -1, LEVEL, NODE, icon,S_ID  FROM MENU
    CONNECT BY PRIOR S_ID=S_NO
    START WITH S_ID=1
    order by to_number(s_id)
    
            -1      LEVEL NODE                 ICON                 S_ID 
    ---------- ---------- -------------------- -------------------- -----
            -1          1 MENU                 menu                 1    
            -1          2 SETUP                profile              2    
            -1          3 Location             location             3    
            -1          3 Department           public               4    
            -1          3 Designation          info                 5    
            -1          3 Shift                abc                  6    
            -1          3 Divisions            house                7    
            -1          3 Transporter          Trans                8    
            -1          3 Bank                 bank                 9    
            -1          3 Leave_Type           hospital             10   
    10 rows selected
    I checked again all the icons in the extract with Winrar jar file

    Published by: 867210 on February 7, 2013 23:46

    Edit the Registry.dat file

    First edit this default path and stop OJ4J  and start and run form.
    default.icons.iconpath=
    
    if not working then try this
    default.icons.iconpath=icons
    

    concerning
    -Ahmed

  • Structuring a QVariantList for GroupDataModel and hierarachy good tree

    I have two QVariantLists that contain the QVariantMaps.

    How to structure the global QVariantList container to be compatible with a GroupDataModel? I am trying to achieve the same hierarchy tree to http://developer.blackberry.com/cascades/reference/index_paths.html. Then I can use indexPaths correctly.

    Thus, for example:

    QVariantList - header1 - listItems

    |

    -2 header - listitems

    What I tried to do this in C++:

    //Should be 'branch' 0
    QVariantList beforeList;
    beforeList.append(beforeMap);
    
    //Should be 'branch' 1
    QVariantList afterList;
    afterList.append(afterMap);
    
    QVariantList mainList;
    mainList.append(beforeList);
    mainList.append(afterList);
    

    This excludes the headers. ListView does not appear but all paths in the index are 0, x.

    Could someone show me in C++ how to create the two branches with their headers?

    Thank you!

    You must use sort fields to sort the list and group by a property of your data

    Then, you will get the headers automatically and you can decide if the header contains the full value, or only the first character

    the order of your list is not serious - GroupDataModel will sort and group for you, and provide header and items.

  • Get the value of the tree node


    Hello

    I use the hierarchy tree to build a menu (in oracle 11 gform).

    I need to retrieve the value of the selected node (child_id), and when I write what follows, I get an error: frm-47307: could not get the properties of the tree root node .

    the statement is:

    l_node_value: = Ftree.Get_Tree_Node_Property (htree,: SYSTEM.) TRIGGER_NODE, Ftree.NODE_VALUE);

    I use this query to populate the tree (and it works fine...):

    Select the case sensitive option

    When connect_by_isleaf = 1 then

    0

    When level = 1 then

    1

    on the other

    -1

    end as status

    level

    name as title

    null as an icon

    CHAILD_ID as value

    Of

    (

    SELECT TO_CHAR (CUO. OBJECT_ID) CHAILD_ID,.

    PARENT_ID TO_CHAR (NULL).

    CUO. OBJECT_PROMPT NAME,

    OBJECT_TYPE 'G '.

    OF CRDX_USER_OBJECT COU

    WHERE GROUP_ID = - 1

    UNION

    SELECT TO_CHAR (CGO. OBJECT_ID) CHAILD_ID,.

    TO_CHAR (CGO. PARENT_ID FOLDER_ID),

    CGO. OBJECT_PROMPT NAME,

    OBJECT_TYPE

    OF OGS CRDX_GROUP_OBJECT

    )

    Start by parent_id is null

    connect by parent_id = prior CASE OBJECT_TYPE WHEN 'G' THEN CHAILD_ID END

    Can someone help me?

    Thanks in advance,

    Elad

    : SYSTEM. TRIGGER_NODE is valid for one of the WHEN-TREE-NODE-xxx-triggers.

    If you want to get the value of the node selected in any other place, you need the integrated Ftree.GET_TREE_SELECTION

  • FRM-47323: no nodes are selected in the tree.

    Hi all

    I'm currently upgrading my forms 6i in 11g. 6i form is currently using the element of the hierarchy tree.
    After the form conversion, 11 g and the execution of the form I get the error FRM-47323 following "no nodes are selected in the tree.
    The same shape work very well in the environment of 6i.

    This error is not documented anywhere and am not sure why only after upgrading to 11g it gives this error.

    After debugging the code, I noticed that the following code will fail with this error:

    Declare
    .....
    current_node FTREE. NŒUD;
    htree;
    .....
    Begin
    ...... At this point, it fails with the error FRM-47323.
    current_node: = Ftree.Get_Tree_Selection (htree, Ftree.Get_Tree_Property (htree, Ftree.SELECTION_COUNT));
    .....
    End;


    Any help will be appreciated. Let me know if you need more information on this issue.

    current_node: = Ftree.Get_Tree_Selection (htree, Ftree.Get_Tree_Property (htree, Ftree.SELECTION_COUNT));

    The problem is the reference "Ftree.SELECTION_COUNT". The Get_Tree_Selection function returns the reference of the selection tree node NŒUD. The SELECTION_COUNT variable stores a number that represents the number of nodes that are selected. Its been more than a table that a NUMBER because it contains the reference of the index for each node selected in the tree. ;-)

    If you need to know which node is the current selected node, try to use: SYSTEM. Trigger_Node instead.

    Hope this helps,
    Craig B-)

    If someone useful or appropriate, please mark accordingly.

    Published by: Silvere on February 3, 2011 10:27

  • How to order a tree with the help of another column?

    I want to order the nodes of the tree using the column POSITION.

    How can I do this?

    I tried to ORDER BY position in the tree of query design, but who gives a completely weird result for the hierarchy tree.


    http://www.freeimagehosting.NET/uploads/7460540c52.gif

    use the order siblings by clause in your query

     order siblings by position_no
    

    Baig,
    http://baigsorcl.blogspot.com

Maybe you are looking for