7 Replies Latest reply on Jan 10, 2013 5:37 PM by svk1965

    Parent Refresh After Modal Close when using .show_modal method

    svk1965
      I followed the manaul ".show_modal" method in this thread: open Skillbuilders modal page from report

      My question ishow do I refresh the parent when the modal closes?
        • 1. Re: Parent Refresh After Modal Close when using .show_modal method
          714270
          svk1965 wrote:
          I followed the manaul ".show_modal" method in this thread: open Skillbuilders modal page from report

          My question ishow do I refresh the parent when the modal closes?
          Are you talking about refreshing a region in the parent page? If yes, you can execute the following JS code after the modal closes to refresh a specify region:
          parent.$('#<your-region-static-id-here>').trigger('apexrefresh');
          1 person found this helpful
          • 2. Re: Parent Refresh After Modal Close when using .show_modal method
            Tom Petrus
            If you want to fire something that takes place after the modal has closed, you have 3 closing actions to choose from actually: auto close, close, manual close. As described in the docs, auto close will fire when the auto close selector specified in the modal dialog options returns an object (usually this would be the detection of a success message). Manual close will fire when the modal is closed manually (and through js). Close will fire regardless of how the close happened. You can choose these events in the dynamic action "Event" dropdown.
            You could then just create a true action to refresh a certain region.
            • 3. Re: Parent Refresh After Modal Close when using .show_modal method
              svk1965
              Sorry, guys. I am still not understanding so I created https://apex.oracle.com/pls/otn/f?p=38768:1:10812118960261 workspace: SVK user: DEMO pw: developer

              1) Scenario: user clicks on pencil to edit feed name. I open modal using DA. On close of modal page 2, I want to refresh parent page 1.

              2) The other problem that I am having is that after I run the page, I always have to log in again before I can revert back to edit the page.
              • 4. Re: Parent Refresh After Modal Close when using .show_modal method
                Tom Petrus
                The credentials do not work! Did you give the user DEMO developer access?

                1) My point was that it is not necessary to reload the whole page. Yes, you could, but it isn't necessary. What you do is edit the details of a record, and you want the data in the report refreshed when the modal has been closed. To do this, all you need to do is create another dynamic action (on the "parent" page!) which as event hooks into the close event of the modal page plugin. Then you can define a true action which will perform a "Refresh" action on the report.
                2) Are you running this in IE8 by any chance?
                • 5. Re: Parent Refresh After Modal Close when using .show_modal method
                  svk1965
                  Sorry, I fixed the password problem http://apex.oracle.com/pls/apex/f?p=4550:1 Workspace: SVK user: DEMO pw: developer app is *38768* or http://apex.oracle.com/pls/apex/f?p=38768:1

                  Yes, I agree that I only need to refresh the report region in the parent. Because I am manually using .show_modal, I do not see the normal SB Modal Close events in the DA event drop-down. That is my problem. How do I trigger the parent region refresh?

                  Edited by: svk1965 on Jan 10, 2013 7:40 AM
                  • 6. Re: Parent Refresh After Modal Close when using .show_modal method
                    Tom Petrus
                    I just took a look: you already had it set up mostly correct. I changed the "close" event to the "auto close" event though, as that is more appropriate: the refresh only has to happen when the dialog closes because there was a match for the autoclose selector (the success message).
                    What was wrong however was the selection type. The selection type for the Auto Close (and close/manual close) event has to be "DOM Object", and "DOM Object" should be "document". The close does not trigger on a specific region such as you had specified.

                    I also changed the event scope of the "modal open" action from static to dynamic: without this, the popup would not work once pagination occurs.
                    • 7. Re: Parent Refresh After Modal Close when using .show_modal method
                      svk1965
                      Great! Thanks Tom for the edits. I am marking this thread answered.