How can i Use a Heirarcical Tree in Forms 6i

Question : How can i Use a Heirarcical Tree in Forms 6i

Hello every 1 My name is zeeshan i m Getting Problem with heirarcial Tree in forms 6i it gives an excpetion of invalid tree data …

Please tell me how can i use htree in forms
with proper record group query thanks


 

Solution: How can i Use a Heirarcical Tree in Forms 6i

The record group for hierarchical tree should have 5 columns:
1) Initial State – specifies which nodes are expanded/collapsed. Values are 0, 1, -1.
2) Level of node tree depth
3) Displayed value on node
4) Icon name
5) Data — value associated with the node.

Here are the steps you need to follow using emp table in Scott schema:

1) Create a block B1. Create a hierarchical tree item TREE1.

2) Create another block B2. Create a push-button PB1.

3) Create Record Group RG1 with the following query:
SELECT 1, LEVEL, ename, ”, TO_CHAR(empno)
FROM emp
CONNECT BY PRIOR empno = mgr
START WITH job = ‘PRESIDENT’

4) Create WHEN-BUTTON-PRESSED trigger on PB1:
DECLARE
my_tree ITEM;
my_num  NUMBER;

BEGIN
my_tree := Find_Item(‘B1.TREE1’);
my_num  := POPULATE_GROUP(‘RG1’);
FTREE.SET_TREE_PROPERTY(my_tree, FTREE.RECORD_GROUP, ‘RG1’);
END;

5) Create layout and run the program. Click PB1 to populate the tree.

HTH
Ali