I use hierarchical tree for build a menu (in oracle forms 11g).
I need to retrieve the value of the selected node (child_id), and when I write the following statement, I get an error: frm-47307:cannot 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 work fine...):
when connect_by_isleaf = 1 then
when level = 1 then
end as status
,name as title
,null as icon
,CHAILD_ID as value
SELECT TO_CHAR(CUO.OBJECT_ID) CHAILD_ID ,
TO_CHAR(NULL) PARENT_ID ,
FROM CRDX_USER_OBJECT CUO
WHERE GROUP_ID = -1
SELECT TO_CHAR( CGO.OBJECT_ID) CHAILD_ID,
FROM CRDX_GROUP_OBJECT CGO
start with parent_id is null
connect by parent_id = prior CASE OBJECT_TYPE WHEN 'G' THEN CHAILD_ID END
Can anybody help me?
Thanks in advanced,
1) You right !!! I use WHEN-BUTTON-PRESS trigger, and in this trigger I need to write this peace of code to get the current node ( tell me, if this true or there is a short way to achieve the same solution):
-- number of selection by thr user. usually (in our case), equal to 1.
l_num_selected := FTREE.GET_TREE_PROPERTY(HTree, FTREE.SELECTION_COUNT);
-- return the node number, according the order the node appearance
FOR j IN 1..l_num_selected
current_node := FTREE.GET_TREE_SELECTION(HTree, j);
2) another question : Does a tree must have only one root or is possible more then one root?
I have anther question about hierarchal tree:
In the Data Query - I use a parameter in the where clause of the select.
If I use a number (as hard coded) the query work just fine. But when I write a parameter - the tree doesn't appear at all...
As I wrote, the where clause locate in the sub-query inside the union clause.