Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Getulio .

Asked: May 02, 2000 - 1:20 pm UTC

Last updated: May 02, 2019 - 6:46 am UTC

Version:

Viewed 1000+ times

You Asked

I've created a tree and it is populating correctly during the
when-new-form-instance trigger, but my question is that when I
click the mouse on a tree node, the when-tree-node-selection
trigger fires properly and the node is highlighted. But when I
select another node, the when-tree-node-selection trigger fires
twice. Once for the node it is "leaving" and once for the node
it is "entering" (the one I clicked on). I thought this trigger
should ONLY fire for the node I just clicked, not twice.

Is this a bug, or "a feature"???? Is there anyway just to have
the trigger fire for the node selected? I've heard that there
are many bugs with the new navigator tree item. Does anyone have
a list of these bugs/features?

Any help would be greatly appreciated.

Getulio



and Tom said...

the documentation for when-tree-node-selected states:


---------------------------------------------------------
When-Tree-Node-Selected Trigger
Description
Fires when a node is selected or deselected.
Definition Level form or block
---------------------------------------------------------


Perhaps you can keep a global variable "last_node_selected" and incorporate logic such as:


if ( nvl( global.last_node_selected, 'na' ) = :SYSTEM.TRIGGER_NODE )
then
return; -- do not do anything, we must be leaving this node
end if;

global.last_node_selected := :system.trigger_node;

.... rest of code here .....



That way, you'll only process the 'tree-node-selected' event ONCE per node -- not when leaving and entering.



Rating

  (5 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

avoid to fire the WHEN-TREE-NODE-SELECTED trigger, when leaving the node

Gerd Droscher, July 30, 2002 - 12:31 pm UTC

In my case, I must avoid to fire the trigger when the last node is leaving!

I'm using Ftree.Set_Tree_Selection(htree, :system.trigger_node , Ftree.SELECT_ON);
in the WHEN-TREE-NODE-EXPANDED trigger to mark the new node, if've clicked on!

In this case, the WHEN-TREE-NODE-SELECTED trigger fires also for the previous node!

How can I avoid this?!

gerd

One more related question

Anil Singh, January 29, 2004 - 11:14 am UTC

How do i check whether a node is marked selected or not without going thru the loop?
e.g. ftree.get_tree_node_property(<htitm>,<node>,<chk Sel>) returns TRUE if node is selected else FALSE.

Tom Kyte
January 29, 2004 - 1:28 pm UTC

try </code> http://otn.oracle.com/ <code>-> discussion forums.

I honestly haven't used forms since 1995 myself.

how i can create atree in oracle developer

eng tarek zan, May 18, 2004 - 8:41 am UTC

please tell me how i can create atree in oracle developer

Tom Kyte
May 18, 2004 - 4:28 pm UTC

page up, goto otn

What can I do?

shirley, April 28, 2005 - 7:48 am UTC

When Multi-Selection property is seted to true!

A reader, April 30, 2019 - 10:15 am UTC

I know this is an old post, but you could use :SYSTEM.trigger_node_selected = 'TRUE' to know if the node is being selected or deselected.
Connor McDonald
May 02, 2019 - 6:46 am UTC

Thanks for the input. Good to see Forms still out there :-)

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library