I was going to write this blog post back in December 2017, but a colleague on the APEX Development team told me it was unnecessary (because numerous examples are available in the Sample Database Application and other sample applications, and it’s even in the documentation ). Well, I received this question from an internal employee today:
“When I edit the page and update the row and save and close the modal page, existing report doesn’t refresh the page with revised value. It was working on another page, but not working on this new page (I built last week). Couldn’t find a way to refresh it as soon as I close the modal window with saved data.”
He has a report and a form in his application, and the form opens up in a modal dialog. He simply wants the report on the parent page to refresh after the modal dialog is closed. Simple, right?
For anyone well-versed in APEX, you’ll find this blog post superfluous. But for everyone else who is looking for the quick explanation, as I’ve received this question 3 times in the past couple months, here it is.
- On the report page, create a new Dynamic Action and enter the following attributes:
- Nam e:
- Even t: Dialog Closed
- Selection Typ e: Region
- Action: Refresh
- Selection Type: Region
That’s really all there is to it. If you have multiple regions on the parent page, you could add multiple True actions for the dynamic action. If the triggering event of the modal dialog is a button instead of a region, you could specify that as your Selection Type for the triggering event. If there are multiple regions on the page which could open the modal dialog, you could even use a jQuery Selector and reference multiple elements as your Selection Type for the triggering event.
You should get this behavior out of the box when creating an application with a report and form, or adding a report and form to your application. But if you’re manually adding components, then it’s really quite easy and straightforward to add this functionality to your APEX app.
If you install the Sample Database Application, you’ll find numerous examples of this dynamic action refresh operation after the close of a modal dialog. And it is briefly documented in this tip .