SYSTEM.RIGHT_MOUSE_TRIGGER_NODE
The system variable :SYSTEM.RIGHT_MOUSE_TRIGGER_NODE holds the node ID of the underlying tree item on which the right mouse was clicked. To extract the node ID, use the following:
node_value varchar2(100);
node_value := :SYSTEM.RIGHT_MOUSE_TRIGGER_NODE;
The node ID of the tree item is extracted for the right mouse button that was clicked. The node ID is stored only if the tree has a popup menu attached. Note that when there is no popup menu attached, the right mouse click event is not sent to the Forms server.
To select the tree item on right click, the application developer should add the following in the PRE-POPUP-MENU trigger:
htree := Find_Item('blockname.treename');
Ftree.Set_Tree_Selection(htree, :SYSTEM.RIGHT_MOUSE_TRIGGER_NODE,
tree.SELECT_ON);
Note that the tree item which was already selected is not unselected. To unselect the tree item, add the following code before moving the focus to the new tree item as mentioned above:
num_selected := Ftree.Get_Tree_Property(htree, Ftree.SELECTION_COUNT);
FOR j IN 1..num_selected LOOP
node := Ftree.Get_Tree_Selection(htree, j);
Ftree.Set_Tree_Selection(htree, node, Ftree.SELECT_OFF);
END LOOP;