This discussion is archived
7 Replies Latest reply: Mar 24, 2013 7:16 AM by GregorM RSS

MDI child forms not sharing menu with MDI fram window

XeM Newbie
Currently Being Moderated
Hi all,

My forms version is 10g. i have created an MDI application
first i created MDI Fram by setting below properties in w-n-f-i trigger
SET_WINDOW_PROPERTY(FORMS_MDI_WINDOW,POSITION,5,5);
SET_WINDOW_PROPERTY(FORMS_MDI_WINDOW,TITLE,'My App');
SET_WINDOW_PROPERTY(FORMS_MDI_WINDOW,WINDOW_SIZE,830,590);
And i attached my menu module to this form
Now, when i run this form it loads the menu and everything works fine but when i open another form by a menu item then the new form opens with default menu module not my MDI menu. I want to keep the same MDI menu for all other forms also. for opening different forms i am using open_form built in.

Thanks
  • 1. Re: MDI child forms not sharing menu with MDI fram window
    HamidHelal Guru
    Currently Being Moderated
    XeM wrote:
    Hi all,

    My forms version is 10g. i have created an MDI application
    first i created MDI Fram by setting below properties in w-n-f-i trigger
    SET_WINDOW_PROPERTY(FORMS_MDI_WINDOW,POSITION,5,5);
    SET_WINDOW_PROPERTY(FORMS_MDI_WINDOW,TITLE,'My App');
    SET_WINDOW_PROPERTY(FORMS_MDI_WINDOW,WINDOW_SIZE,830,590);
    And i attached my menu module to this form
    Now, when i run this form it loads the menu and everything works fine but when i open another form by a menu item then the new form opens with default menu module not my MDI menu. I want to keep the same MDI menu for all other forms also. for opening different forms i am using open_form built in.
    Hi XeM
    You have to assign you Menu to every module. So far i know there is no runtime CODE

    Hope this helps

    Hamid
  • 2. Re: MDI child forms not sharing menu with MDI fram window
    XeM Newbie
    Currently Being Moderated
    Thank You Hamid!

    I was checking that there would might be some built-in procedure or properties setting that might do the job.
  • 3. Re: MDI child forms not sharing menu with MDI fram window
    GregorM Explorer
    Currently Being Moderated
    Hi.

    I suppose you have call second form you use open_form built-in. If that so, try to use replace_menu command. I advise you to put this call on when-window-activated. This way your menu will refresh every time you switch between forms.

    Best regards.
  • 4. Re: MDI child forms not sharing menu with MDI fram window
    HamidHelal Guru
    Currently Being Moderated
    XeM wrote:
    Thank You Hamid!

    I was checking that there would might be some built-in procedure or properties setting that might do the job.
    Yes there is something i remember.
    If you use CALL_FORM Built-in to open the new form there is option of replacing of Menu. Example
     CALL_FORM(formmodule_name VARCHAR2,display NUMBER,switch_menu NUMBER,query_mode NUMBER,data_mode NUMBER,paramlist_name VARCHAR2); 
    Hope this helps

    Hamid
  • 5. Re: MDI child forms not sharing menu with MDI fram window
    XeM Newbie
    Currently Being Moderated
    Thank you all,

    To get the job done i am adopting one of above options because both works correctly with my requirments. However i am leaving this thread open if someone could suggest any efficient way to do the same.
    if anyone could suggest that what is good option for MDI application to switch between forms and open new forms CALL_FORM or OPEN_FORM.
  • 6. Re: MDI child forms not sharing menu with MDI fram window
    HamidHelal Guru
    Currently Being Moderated
    XeM wrote:
    Thank you all,

    To get the job done i am adopting one of above options because both works correctly with my requirments. However i am leaving this thread open if someone could suggest any efficient way to do the same.
    if anyone could suggest that what is good option for MDI application to switch between forms and open new forms CALL_FORM or OPEN_FORM.
    Here are main topic on Both

    CALL_FORM_
    Runs an indicated form while keeping the parent form active. Oracle Forms runs the called form with the same Runform preferences as the parent form. When the called form is exited Oracle Forms processing resumes in the calling form at the point from which you initiated the call to CALL_FORM

    CALL_FORM Restrictions
    Oracle Forms ignores the query_mode parameter when the calling form is running in QUERY_ONLY mode. Oracle Forms runs any form that is called from a QUERY_ONLY form as a QUERY_ONLY form, even if the CALL_FORM syntax specifies that the called form is to run in NO_QUERY_ONLY (normal) mode. A parameter list passed to a form via CALL_FORM cannot contain parameters of type DATA_PARAMETER. Only text parameters can be passed with CALL_FORM. Some memory allocated for CALL_FORM is not deallocated until the Runform session ends. Exercise caution when creating a large stack of called forms. When you execute CALL_FORM in a Pre-Logon, On-Logon, or Post-Logon trigger, always specify the DO_REPLACE parameter to replace the calling form's menu with the called form's menu. Failing to specify DO_REPLACE will result in no menu being displayed for the called form. (An alternative solution is to call the REPLACE_MENU built-in from a When-New-Form-Instance trigger in the called form.) If you execute CALL_FORM from Menu PL/SQL code, and subsequently replace the current menu in the called Form, thecode after the CALL_FORM in the menu program unit does not execute when the called Form is exited and control returnsto the calling Form. This behavior is because replacing the current menu destroys any code that is executing in the menu being replaced


    OPEN_FORM_
    Opens the indicated form. Use OPEN_FORM to create multiple-form applications, that is, applications that open more than one form at the same time.

    OPEN_FORM Restrictions
    You can set session On for all Runform invocations by setting the FORMSnn_SESSION environment variable to TRUE. When you set the FORMSnn_SESSION variable, all Runform invocations inherit its setting, unless you override the environment variable by setting the Session option from the Runform command line. If you set session_mode to SESSION when you use OPEN_FORM to create a multiple-form application, you cannot set data_mode to SHARE_LIBRARY_DATA (Oracle Forms will display a runtime error message).

    Decide what is best for your...

    My opinion
    If you want to open multi form then use OPEN_FORM AND replace_menu
    and if only one form then use CALL_FORM.

    Hope this works..

    Hamid
  • 7. Re: MDI child forms not sharing menu with MDI fram window
    GregorM Explorer
    Currently Being Moderated
    Hi.

    XeM why do you think replace_menu is not efficient way to to it. I believe this is the best answer you can get for out of the box functionality. Ok, there is a way to do it using Java Bean but this is an advanced topic.

    Best regards.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points