How to use Hierarchical Tree,OCX ActivX acomponents in Oracle9i Forms. Will any body help me with some example source code, so that I can use it in my practice project.
create one non database block e.g. tree_block then
add hieraachical control item in that. e.g htree
create record group fron record group node e.g. htree_rg
select 1, level, ename,NULL,TO_CHAR(empno)
from emp
start with mgr IS NULL
connect by prior empno = mgr
//
and apply this record group to htree hierarchiacl tree through property pallet.
//
trigger at tree_block name is WHEN_TREE_NODE_SELECTED
DECLARE
v_htree ITEM;
node_value VARCHAR2(100);
BEGIN
Message('Working... (0%)'|| :SYSTEM.TRIGGER_NODE, NO_ACKNOWLEDGE);
-- Find the tree id.
v_htree := Find_Item('tree_block.htree');
-- Find the value of the node clicked on.
-- The SYSTEM.TRIGGER_NODE environment variable is the node the user
-- clicked on.
node_value := Ftree.Get_Tree_Node_Property(v_htree,
:SYSTEM.TRIGGER_NODE, Ftree.NODE_VALUE);
-- Modify the Where Clause in the EMP Block.
SET_BLOCK_PROPERTY('emp', DEFAULT_WHERE, 'empno = ' || node_value);
GO_BLOCK ('emp');
EXECUTE_QUERY;
END;
/
ADD TRIGGER WHEN-NEW-FORM-INSTANCE AT FORM LEVEL
DECLARE
rg_num NUMBER;
v_htree ITEM;
BEGIN
rg_num := POPULATE_GROUP('htree_rg');
v_htree := FIND_ITEM('tree_block.htree');
FTREE.POPULATE_TREE(v_htree);
END;
//
note :- at every level fire one trigger on-error if you get error coding is
null;