3 Replies Latest reply on Aug 31, 2011 8:24 AM by S-Max

    Close Popup and Redirect Parent

    Mike Straka-Oracle

      I have an application with a report page (page 3) showing a list of opportunities. There is a button on the page to add an opportunity. Clicking this button redirects to a form page (page 241) in a popup window using the button action = redirect to url with the url:
      On the popup form, there are two buttons. The Cancel button simply closes the window, again with a redirect to url:
      The Create button submits the page for normal DML processing. I have added a final page process on the popup page of type 'close popup window' that is conditional on pressing the Create button. This all works fine, the popup closes, the database is updated and the user is back on the report page 3.

      However, what I really need to do is instead of having them back on the report page, I need to redirect them to another page (page 242) where the can add additional details to the row they just created in the popup form.

      Is there a simple way to do this? I have searched the forum and the web extensively. Perhaps I'm not using the right search terms, because I haven't come up with a solution. I've tried various javascript approaches to alter the parent window url (e.g., window.opener.href = "<url>", but of course this doesn't work after the page has been submitted.

      I suppose it would be possible to have an application item that I could set in the popup page and then have an "On Load: Before Header" branch on the report page that would check the value of this application item and redirect to the detail page (242) if it was set to a particular value. Is there an easier/more direct way?

        • 1. Re: Close Popup and Redirect Parent
          Hi Mike,

          here is an example especially for you:
          1 person found this helpful
          • 2. Re: Close Popup and Redirect Parent
            Mike Straka-Oracle
            Hi S-Max,

            Thanks for this link. It is helpful. I am not quite able to get it to work, however. The popup page needs to be submitted so the DML processing kicks in and inserts the new row in the table. I still can't get the parent to redirect. Probably some issue in my code. I will continue to tinker with it and see if I can get it to work.

            • 3. Re: Close Popup and Redirect Parent
              Hi Mike,

              OK. Should it be the After Submit Page Process only, or can you create for this purpose a dynamic action (if you are on the APEX 4.0 or newer) or an Ajax process if you on APEX release prior APEX 4.0?

              I have change my example application and added some dynamic actions.
              There are now two buttons:
              1. "Select Department" - with the "old" functionality
              2. "Create Department" - with the "New" functionality.

              The button "Create Department" opens a Pop-Up window with a form to insert a new department. When you click on the button "Create" the dynamic action will be fired - inserts the new department, redirects the new department number to the parent page and after this it opens the next page with the employee information for the fresh created department.

              Please test this example, that hopefully earns the "Correct Answer" note ;-)