Home » Developer & Programmer » Forms » select tree value insert into text box (form 6i)
select tree value insert into text box [message #603292] Fri, 13 December 2013 01:13 Go to next message
shahzad-ul-hasan
Messages: 615
Registered: August 2002
Senior Member
Dear
i want to insert the tree selected value into text box.please advised me the all details.
Re: select tree value insert into text box [message #603336 is a reply to message #603292] Fri, 13 December 2013 08:44 Go to previous messageGo to next message
deepakmannazhi
Messages: 137
Registered: February 2010
Location: Dubai, UAE
Senior Member

Hai Shahzad,

Please write this in Quote:
WHEN-TREE-NODE-SELECTED
trigger

DECLARE
  htree item;
  node_selected NUMBER;
  current_node ftree.node;
  
BEGIN

  htree           := Find_Item('TREE_BLK.TREE');
  node_selected   := Ftree.Get_Tree_Property(htree, Ftree.SELECTION_COUNT);
  current_node  := Ftree.Get_Tree_Selection(htree, node_selected);
  :BLOCK.TEXT_BOX:= Ftree.Get_Tree_Node_Property(htree, current_node, Ftree.NODE_VALUE);
  
END ;


Hope this will help you Smile

[Updated on: Fri, 13 December 2013 08:51]

Report message to a moderator

Re: select tree value insert into text box [message #603340 is a reply to message #603336] Fri, 13 December 2013 09:38 Go to previous messageGo to next message
shahzad-ul-hasan
Messages: 615
Registered: August 2002
Senior Member
dear
Please SEE THE ATTACHED PICTURE. IT WILL INSERT THE VALUE OF THE NODE NOT THE TEXT WHICH I SELECT..please advised.
The Medicin box is multi line. for example if doctor select multiple medicine then what will be the output.
  • Attachment: 12.JPG
    (Size: 48.01KB, Downloaded 854 times)

[Updated on: Fri, 13 December 2013 09:39]

Report message to a moderator

Re: select tree value insert into text box [message #603375 is a reply to message #603340] Sat, 14 December 2013 10:17 Go to previous messageGo to next message
deepakmannazhi
Messages: 137
Registered: February 2010
Location: Dubai, UAE
Senior Member

Hai Shazad,

Please see attached fmb, this will help you.

this is the code which i have written in when-button_press-trigger.

and also set tree'sMulti-Selection property to YES


DECLARE
   htree           item;
   node_selected   NUMBER;
   current_node    ftree.node;
   v_count    NUMBER;
   node_label      VARCHAR2 (3000);
   node_state      VARCHAR2 (15);
BEGIN
   htree := FIND_ITEM ('TREE_BLOCK.TREE4');
   
   v_count := ftree.GET_TREE_PROPERTY (htree, ftree.selection_count);

   FOR j IN 1 .. v_count
   LOOP
      node_state := ftree.GET_TREE_NODE_PROPERTY (htree, j, ftree.node_state);

      IF node_state = ftree.leaf_node
      THEN
         current_node := ftree.GET_TREE_SELECTION (htree, j);
         node_label :=node_label||CHR(10)||
            ftree.GET_TREE_NODE_PROPERTY (htree,
                                          current_node,
                                          ftree.node_label
                                         );
         
      END IF;
   END LOOP;
   
   :CTRL_BLK.TEXT1:= node_label;
END ;


Sample table

CREATE TABLE TESTTAB
(
  EID    VARCHAR2(20 BYTE),
  ENAME  VARCHAR2(200 BYTE),
  MID    VARCHAR2(20 BYTE)
);




Regards
Deepak
Re: select tree value insert into text box [message #603376 is a reply to message #603375] Sat, 14 December 2013 10:19 Go to previous messageGo to next message
deepakmannazhi
Messages: 137
Registered: February 2010
Location: Dubai, UAE
Senior Member

Please have a look at the screenshot too.
  • Attachment: tree.png
    (Size: 12.48KB, Downloaded 849 times)
Re: select tree value insert into text box [message #603682 is a reply to message #603376] Wed, 18 December 2013 07:19 Go to previous message
shahzad-ul-hasan
Messages: 615
Registered: August 2002
Senior Member
thx for our nice help .my issued is solved.
Previous Topic: canvas
Next Topic: Records not display when i selected
Goto Forum:
  


Current Time: Thu Apr 25 23:09:49 CDT 2024