Monday, June 1, 2015



WHEN-TREE-NODE-SELECTED Trigger Tip



In the name of Allah, Most Gracious, Most Merciful
Praise be to Allah, blessing and peace be upon our prophet Mohammed, his family and his companions. After that,



Key Problem: Many Oracle developers may not aware of or perhaps they are deceived by the name of the trigger "SELECTED" as it has only one way functionality, when you select the tree node, firing the trigger "WHEN-TREE-NODE-SELECTED". Facing the fact the Trigger doesn't work properly.



Key Solution: As a matter of fact the "WHEN-TREE-NODE-SELECTED" trigger fires twice; it fires when a node is selected or deselected.



Consequently, you need to consider adding the below if condition into your the "WHEN-TREE-NODE-SELECTED" trigger. This will make your code properly executed only when you select the node and not when you deselect it.



IF :SYSTEM.TRIGGER_NODE_SELECTED = 'TRUE' THEN

 -- List your logical execution code

END IF;


If  your item name is the node's label itself you can easily do this:



IF :SYSTEM.TRIGGER_NODE_SELECTED = 'TRUE' THEN

  :block_name.item_name  := FTREE.GET_TREE_NODE_PROPERTY(HTREE$, :SYSTEM.TRIGGER_NODE, FTREE.NODE_LABEL);

END IF;




Hope this helps…



My success only comes from Allah, pls. note your comments and suggestions are great help for me in progress thanks in advance.






No comments :