Download Source Code
Providing an example form for creating hierarchical trees in Oracle Forms to control data Block records. The This form whenever the user selects any node in the tree menu then corresponding the record is displayed at right side.
This form was having a data blocks, EMP and control, the Control block is having a tree Item and populating that tree on PR E-form trigger with the following code:
Ftree.populate_tree (' CONTROL. Emp_tree ');
Ftree.set_tree_property (' CONTROL. Emp_tree ', Ftree. Query_text,
' SELECT decode (level, 1, 1,-1), Level, Initcap (ename), ' Fxrun ', ' | |
' Empno from scott_emp ' | |
' START with Mgr are NULL CONNECT by PRIOR empno = Mgr ');
And whenever user select any node then the following code was written on when-tree-node-selected trigger to fetch the Recor D for the selected employee:
Go_block (' EMP ');
Set_block_property (' EMP ', Default_where, ' empno= ' | |
Ftree.get_tree_node_property (' CONTROL. Emp_tree ',: SYSTEM. Trigger_node,
Ftree. Node_value));
Execute_query;
The Fxrun.ico icon and table scott_emp is used in this example and script of this table and icon file be available in Sou RCE code.
Like the US to get notifications for free source code in the future, thanks.
Create hierarchical Tree to Control Records in Oracle Forms