2 Replies Latest reply: Aug 6, 2014 12:50 AM by archana2 RSS

    Pass parameter to a parent page from the child window and retain the session values in the parent window

    archana2

      Hi,

      I have two apex pages. I open a child page using javascript from the parent page.

       

      Parent window has following items .  P1_Text1, P1_text2, P1_text3 . The  setting is 'Change only when session state is Null', Static assignment.

       

      In the child window : I have two buttons 'Confirm'  and 'Close'.

       

      When I press Confirm button, It sets the value of a parent page item in a PL/SQL process.

       

      BEGIN

      /* some calculations

      followed by one assignment statement */

       

      :P1_Text1:=final_value;

       

      END;

       

      'Close' button in the child window. has following javascript associated with it :

       

      javascript:

      window.opener.location.href =window.opener.location.href;

      window.close();


      When I press close button, the parent window gets refreshed and P1_Text1 is loaded as per the requirement.  Everything is fine till here.


      But the issue is with other page items in the parent page. They become null.


      How to retain the values of page items of parent window ?



      Regards,

      Archana



       






        • 1. Re: Pass parameter to a parent page from the child window and retain the session values in the parent window
          Mike Kutz

          archana2 wrote:


          But the issue is with other page items in the parent page. They become null.

           

          How to retain the values of page items of parent window ?

          Problem:  You're not "saving" the other page items.

           

          Solution:  Before you open the child window, you need to "submit" the values you want saved on the server side.

           

          This is best done with a Dynamic Action that uses a PL/SQL block of code.  The key thing is to include all the Items you want to Save in the "Page items to Submit" property.

          PL/SQL code is a simple no-ops code

          begin
            null;
          end;
          

           

          For you, it sounds like the "open child window" should be the 2nd action of this Dynamic Action.

           

          MK

          • 2. Re: Pass parameter to a parent page from the child window and retain the session values in the parent window
            archana2

            Thank you very much Mike for the idea. Submitting the page before calling the child window did the work

            I have done the following :

             

            This is the link from where I call the pop up window :

            <SPAN class="pss_text8">To open the window.<a href="javascript:apex.submit();window.void(open('/pls/apex/f?p=112:33:&SESSION.','mywindow','width=800,height=400', 'bReplace=true'));"><SPAN class="pss_text8">click here  </a>

             

            I added apex.submit();  code in it and also created a unconditional branch to that page.

             

            It worked very well !

             

            Regards,

            Archana