problem with finding a node in a tree [message #546179] |
Mon, 05 March 2012 10:10 |
|
baliberde
Messages: 201 Registered: January 2012 Location: outer space
|
Senior Member |
|
|
I have a problem with finding a node in my tree, I've searched this on the online help and followed the codes there, but when I click the find button, it threw a message NO DATA FOUND.
here is the code that I used in find button:
DECLARE
tri ITEM;
hanapin_mYnode FTREE.NODE;
BEGIN-- Find the tree itself.
tri := FIND_ITEM('tree_section.tree_subjects');
hanapin_mYnode := FTREE.FIND_TREE_NODE(tri,'1st Semester',
FTREE.FIND_NEXT, FTREE.NODE_LABEL, FTREE.ROOT_NODE, FTREE.ROOT_NODE);
hanapin_mYnode := FTREE.FIND_TREE_NODE(tri,:newstudents.find_node,
FTREE.FIND_NEXT, FTREE.NODE_LABEL, hanapin_mYnode, hanapin_mYnode);
IF NOT FTREE.ID_NULL(hanapin_mYnode) THEN
Message('No data found');
END IF;
END;
|
|
|
Re: problem with finding a node in a tree [message #546209 is a reply to message #546179] |
Mon, 05 March 2012 14:25 |
owais_baba
Messages: 289 Registered: March 2008 Location: MUSCAT
|
Senior Member |
|
|
why u put this code did u find some null value while running your form
-----Your Code-------------------------------
IF NOT FTREE.ID_NULL(hanapin_mYnode) THEN
Message('No data found');
END IF;
-----------------------------------------------
ON-ERROR
NUll;
or
Handle Error
-- Sample ON-ERROR trigger
begin
if abs ( message_code ) = XXXX then
clear_message;
bell;
message( message_text, no_acknowledge );
else
message (message_text );
end if;
end;
------------------------------------
NOW
can u explain what exactly you are trying to do read this code first
DECLARE
-- To store the tree
mytree ITEM;
-- To store the value of the node selected
value_of_mynode VARCHAR2(100);
-- To store the label of the node selected
label_of_mynode VARCHAR2(100);
BEGIN
-- Display message only when selecting the Tree
If (:System.trigger_node_selected = 'TRUE') then
-- Find out the tree
mytree := Find_Item('<BLOCK>.<TREE>');
-- Get the value of the node clicked on.
value_of_mynode :=
Ftree.Get_Tree_Node_Property
(mytree, :SYSTEM.TRIGGER_NODE,
Ftree.NODE_VALUE);
label_of_mynode :=
Ftree.Get_Tree_Node_Property
(mytree, :SYSTEM.TRIGGER_NODE,
Ftree.NODE_LABEL);
Message ('The Label of the Selected Node : '||label_of_mynode);
Message ('The Value of the Selected Node : '||value_of_mynode);
End if;
END;
Thanks
[Updated on: Mon, 05 March 2012 14:45] Report message to a moderator
|
|
|