Skip to Main Content

Breadcrumb

more

Connor and Chris don't just spend all day on AskTOM. You can also catch regular content via Connor's blog and Chris's blog. Or if video is more your thing, check out Connor's latest video and Chris's latest video from their Youtube channels. And of course, keep up to date with AskTOM via the official twitter account.

Question and Answer

Tom Kyte

Thanks for the question, Getulio .

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

Answered by: Tom Kyte - Last updated: May 02, 2019 - 6:46 am UTC

Category: - Version:

Viewed 1000+ times

Whilst you are here, check out some content from the AskTom team: PL/SQL Brain Teaser: Raising NO_DATA_FOUND - let me count the ways

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 we 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.



and you rated our response

  (5 ratings)

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

Reviews

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

July 30, 2002 - 12:31 pm UTC

Reviewer: Gerd Droscher from styria/austria/europe

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

January 29, 2004 - 11:14 am UTC

Reviewer: Anil Singh from PA

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

Followup  

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

May 18, 2004 - 8:41 am UTC

Reviewer: eng tarek zan from canada

please tell me how i can create atree in oracle developer

Tom Kyte

Followup  

May 18, 2004 - 4:28 pm UTC

page up, goto otn

What can I do?

April 28, 2005 - 7:48 am UTC

Reviewer: shirley from China

When Multi-Selection property is seted to true!

April 30, 2019 - 10:15 am UTC

Reviewer: A reader

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

Followup  

May 02, 2019 - 6:46 am UTC

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