1 2 Previous Next 18 Replies Latest reply: Jan 5, 2010 12:17 PM by 742134 RSS

    How open new from through a selected tree node....using open_form

    742134
      Hi All,

      I have
      setup with values in a tree
      -- currency
      -- Employees
      -- Item
      -- Location
      -- supplier
      -- UOM

      Naw when I select currency node it should open currency form,
      similarly when i select Epmloyees node , Employees form should opened and so on.

      Help me...
      What should be the Query ?


      Archana V.
        • 1. Re: How open new from through a selected tree node....using open_form
          Sarah
          hi

          if u check u r privious post i have been already given u a solution.


          create working directory and copy all u r fmb and fmx mmb mmx to the same directory.
          for this u have to modify default.env.

          Default.env
          # Search path for Forms applications (.fmx files, PL/SQL libraries)
            # If you need to include more than one directory, they should be semi-colon
            # separated (e.g. c:\test\dir1;c:\test\dir2)
            #
            FORMS_PATH=e:\DevSuiteHome_1\forms;E:\Oracle FMBs
          sarah
          • 2. Re: How open new from through a selected tree node....using open_form
            Manu.
            Archana,

            You have to bring the form name in to the tree. The query will contain State of the Node, Level of the Node, Displaying Value, Icon Name, Hidden Value. So you can have the form name as the hidden value. So In the WHEN-MOUSE-DOUBLE-CLICK trigger of the tree, write,
            DECLARE
                 HTree ITEM;
              Str_Temp VARCHAR2(50);        
                 Str_Form_Name VARCHAR2(20);
            Begin
                  HTree    := FIND_ITEM('<block_name>.<tree_name>');
                 Str_Temp := FTree.GET_TREE_NODE_PROPERTY(HTree, :SYSTEM.TRIGGER_NODE, FTree.NODE_DEPTH);
              IF Str_Temp != 1 THEN
                      Str_Form_Name := FTree.GET_TREE_NODE_PROPERTY(HTree, :SYSTEM.TRIGGER_NODE, FTree.NODE_VALUE);
                   OPEN_FORM(Str_Form_Name, ACTIVATE, SESSION, NO_SHARE_LIBRARY_DATA);
              END IF;              
            EXCEPTION WHEN OTHERS THEN NULL;
            END;
            This will open the form corresponding to the node selected.


            Regards,


            Manu.



            If my response or the response of another was helpful, please mark it accordingly
            • 3. Re: How open new from through a selected tree node....using open_form
              Sarah
              hi

              try something like this.

              when-tree-node-activated trigger
              begin
              clear_message;
              call_form( ftree.get_tree_node_property( 'b_tree.tree_name', :system.trigger_node, ftree.node_value ) );
              end;
              sarah
              • 4. Re: How open new from through a selected tree node....using open_form
                742134
                hi

                Thanks for ur help,

                But

                FRM-47307: Cannot get the properties of the tree root node.


                IT is throwing this error....




                Archana V.
                • 5. Re: How open new from through a selected tree node....using open_form
                  Manu.
                  Archana,

                  From which line you got the error? And what is the select statement you gave for the tree? And also please paste the code written in WHEN-MOUSE-DOUBLE-CLICK trigger of the tree.


                  Regards,


                  Manu.
                  • 6. Re: How open new from through a selected tree node....using open_form
                    742134
                    Hi
                    Manu

                    the code is like this

                    DECLARE
                         HTree ITEM;

                    Str_Temp VARCHAR2(50);

                         Str_Form_Name VARCHAR2(20);
                    Begin
                         HTree := FIND_ITEM('BLOCK6.ITEM7');
                         Str_Temp := FTree.GET_TREE_NODE_PROPERTY(HTree, :SYSTEM.TRIGGER_NODE, FTree.NODE_VALUE);
                         :BLOCK6.ITEM7 := Str_Temp;                    
                         Str_Temp := FTree.GET_TREE_NODE_PROPERTY(HTree, :SYSTEM.TRIGGER_NODE, FTree.NODE_DEPTH);
                    IF      Str_Temp = 1 THEN
                              Str_Form_Name := FTree.GET_TREE_NODE_PROPERTY(HTree, :SYSTEM.TRIGGER_NODE, FTree.NODE_VALUE);
                         OPEN_FORM(:GLOBAL.FORM_PATH||'CURRENCY');
                    END IF;          
                    EXCEPTION WHEN OTHERS THEN NULL;
                    END;


                    and i am facing the error


                    Archana,
                    • 7. Re: How open new from through a selected tree node....using open_form
                      Manu.
                      Archana,

                      Change the coding to
                      DECLARE
                           HTree ITEM;
                           Str_Temp VARCHAR2(50);
                           Str_Form_Name VARCHAR2(20);
                      Begin
                           HTree := FIND_ITEM('BLOCK6.ITEM7');
                           Str_Temp := FTree.GET_TREE_NODE_PROPERTY(HTree, :SYSTEM.TRIGGER_NODE, FTree.NODE_DEPTH);
                           IF Str_Temp != 1 THEN
                                Str_Form_Name := FTree.GET_TREE_NODE_PROPERTY(HTree, :SYSTEM.TRIGGER_NODE, FTree.NODE_VALUE);
                                OPEN_FORM(:GLOBAL.FORM_PATH || Str_Form_Name);
                           END IF;
                      EXCEPTION WHEN OTHERS THEN NULL;
                      END;
                      And i won't recommend to use the full path in the OPEN_FORM built-in. And if you are using that why make sure the *:GLOBAL.FORM_PATH* contains a *\* at the end.


                      Regards,


                      Manu.


                      If my response or the response of another was helpful, please mark it accordingly
                      • 8. Re: How open new from through a selected tree node....using open_form
                        742134
                        Manu,


                        still the same error is there
                        i.e
                        FRM-47307: Cannot get the properties of the tree root node.

                        instade of find item

                        can i use FIND_TREE_NODE Built-in
                        Help me...




                        Archana
                        • 9. Re: How open new from through a selected tree node....using open_form
                          Manu.
                          Archana,

                          The item *:BLOCK6.ITEM7* is the tree item, right? If no, then put the tree name in place of that. And you cannot use FIND_TREE_NODE instead of FIND_ITEM. because then only we can get the tree pointer, and using that other values.


                          Regards,


                          Manu.
                          • 10. Re: How open new from through a selected tree node....using open_form
                            742134
                            Menu,

                            yes
                            :BLOCK6.ITEM7 is a tree item A i have already placed it,
                            still it is not working...................




                            Archana V
                            • 11. Re: How open new from through a selected tree node....using open_form
                              RamiahRAGU
                              Archana,

                              i use below code and it's working fine..
                              DECLARE
                                        htree ITEM; 
                                        node_value number; 
                                        V_MENU VARCHAR2(200);
                              BEGIN
                                        htree            := Find_Item('BLOCK2.TREE4');
                                        node_value := Ftree.Get_Tree_Node_Property(htree, :SYSTEM.TRIGGER_NODE, Ftree.NODE_VALUE);
                              
                                        SELECT MENU_LINK INTO V_MENU
                                        FROM my_table
                                        WHERE MENU_ID = node_value;
                              
                                        :GLOBAL.MENU_ID := node_value;
                              
                                        NEW_FORM(V_MENU);
                              END;
                              make sure the MENU_ID is unique and it's assigned in the node.
                              • 12. Re: How open new from through a selected tree node....using open_form
                                Andreas Weiden
                                Is your tree already populated? If so, how did you populate it and what values did you assign to the node-values.

                                If you use the form-name as node_value, your code could like like:
                                DECLARE
                                  HTree ITEM;
                                  Str_Form_Name VARCHAR2(20);
                                Begin
                                  HTree := FIND_ITEM('BLOCK6.ITEM7');
                                  Str_Form_Name := FTree.GET_TREE_NODE_PROPERTY(HTree, :SYSTEM.TRIGGER_NODE, FTree.NODE_VALUE);
                                  OPEN_FORM(:GLOBAL.FORM_PATH||Str_Form_Name);
                                END;
                                and be sure to use the correct trigger to put your code in (WHEN-TREE-NODE-ACTIVATED)
                                • 13. Re: How open new from through a selected tree node....using open_form
                                  742134
                                  Hi,

                                  I think it is working..... but having an error,

                                  FRM:-40010-Cannot read from D:\practice\10.

                                  D:\practice is the path.

                                  10 is what? I think it is taking the value of tree node........

                                  Plzzzzz Help me..............



                                  Archana V.
                                  • 14. Re: How open new from through a selected tree node....using open_form
                                    Andreas Weiden
                                    If you used my code, then, yes, its the node-value. Please show us the code you used to populate your tree.
                                    1 2 Previous Next