DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: example for tree view

  1. #1
    Join Date
    Apr 2001
    Location
    hyderabad,india
    Posts
    27

    Cool

    hai guys,
    i have a problem in creating a tree view in oracle forms 6i .
    can u suggest me a detailed example of creating a tree view

    thanks a lot guys

    have a nice day
    with regards
    yejurvad

  2. #2
    Join Date
    Apr 2001
    Location
    UK
    Posts
    137
    The Forms & Menus examples CD contains a form called NAVWIZ which has a hierarchical tree on it. I managed to build a form using this as a template.

  3. #3
    Join Date
    Sep 2001
    Location
    NJ, USA
    Posts
    1,287
    BLOCK : BTREE - only for Tree item



    TREE ITEM : TR ( populated with record group 'r_tree')



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

    -- when-new-form-instance TRIGGER (for populate and open tree)

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



    DECLARE

    v_ignore NUMBER;

    find_node ftree.NODE;

    BEGIN

    --

    -- populate with query and tree item

    --

    Ftree.Set_Tree_Property('Tr', Ftree.RECORD_GROUP, 'r_tree');

    v_ignore := Populate_Group('r_tree');

    Ftree.Populate_Tree('Tr');

    --

    -- set selection on 1 row of tree

    --

    find_node := Ftree.Find_Tree_Node('tr', '', Ftree.FIND_NEXT_CHILD,

    Ftree.NODE_LABEL, Ftree.ROOT_NODE, Ftree.ROOT_NODE);

    Ftree.Set_tree_selection('Tr', find_node, Ftree.SELECT_ON);

    --

    :system.message_level:='10';

    end;



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

    -- r_tree - RECORD GROUP

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



    select 1, level, NAME_ACCOUNT, NULL, REG_ACCOUNT

    from DIC_ACCOUNTS

    connect by prior rg_account = rg_root

    start with rg_root is null

    --

    -- where 1 - open/close node in tree

    -- level - level of tree (start with 1)

    -- null - icon name

    -- NAME_ACCOUNT - visual value

    -- REG_ACCOUNT - node value

    --

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

    -- WHEN-TREE-NODE-SELECTED TRIGGER (for get value from tree)

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

    DECLARE

    cr_n FTREE.NODE;

    BEGIN

    cr_n := Ftree.Get_Tree_Selection('tr', 1);

    :ct.reg_account := Ftree.Get_Tree_Node_Property('tr',

    :SYSTEM.TRIGGER_NODE, Ftree.NODE_VALUE);

    go_block('det_info');

    execute_query;

    go_block('btree');

    END;





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

    -- another example of record group

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



    select decode(level, 1,1, -1),

    level, NAME_PRODUCT,

    decode(t_root,'R','rt_quer2','L','eqp_01','rt_quer2'),

    REG_PRODUCT

    from dic_product

    connect by prior rg_product = rg_root

    start with rg_root is null



    COMMENT:



    1. decode(level, 1,1, -1)

    -- open only 1st level of tree

    2. decode(t_root,'R','rt_quer2','L','eqp_01','rt_quer2'),

    -- root nodes (icon name = 'rt_quer2')

    -- lief nodes (icon name = 'eqp_01')

    -- default (icon name = 'rt_quer2')



    Good luck!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width