In Oracle Apex, when we create a modal dialog form with normal report, then Apex creates a dynamic action for the parent report region to refresh it when the form dialog will close. But if we are creating a report manually then we need to create it ourselves. Here in this tutorial, I will give two examples of dynamic actions, one is to refresh the parent page region on a close dialog by selection type region and another dynamic action is to refresh parent region on a close dialog based on JavaScript expression.
Below is the first example, in which we will create a dynamic action for a report region to refresh it on the close dialog. On my page, I have an interactive report region named "Report 1
" and this report having a link column which is opening a dialog form.
1. Dynamic Action for a Report Region to Refresh on Close Dialog
In Oracle Apex page designer, click on the Dynamic Actions tab, then do the right-click on the Close Dialog node and select Create Dynamic Action option and set the following properties:
- Name: da_report
- Event: Dialog Closed
- Selection Type: Region
- Region: Report 1 (This is the interactive report region on my page)
True Action
- Action: Refresh
- Selection Type: Region
- Region: Report 1
Save the changes and run the report and when you will close the dialog, called from the region "Report 1
", it will refresh the report region.
Now I have a button on the same page from which I am calling another dialog form and on close, I want to refresh another region having an interactive grid. To perform this task, I will create a dynamic action based on the JavaScript expression to refresh the parent region. Follow these steps:
2. Dynamic Action based on JavaScript Expression to Refresh Parent Region
In Oracle Apex page designer, click on the Dynamic Actions tab, then do the right-click on the Close Dialog node and select Create Dynamic Action option and set the following properties:
- Name: da_selectjs
- Event: Dialog Closed
- Selection Type: JavaScript Expression
- JavaScript Expression: window
The following is the screenshot for the above settings:
True Action
- Action: Refresh
- Selection Type: Region
- Region: Report 2 (This is the interactive grid region on my page)
Save the changes and run the page to test.
Related tutorials:
- Oracle Apex: Set Page Items Value Using JavaScript on the Click of a Link in Interactive Report
- Oracle Apex: Highlight Row on Link Click of Interactive Report
- Refresh Current Region Using JavaScript in Oracle Apex
Hi Vinish
Nice video...
i have one query
How do i redirect to a page when i click cancel button on print screen?
Any help would be highly appreciated
Please help me to achieve this
Hi,
How can we open one modal page from another modal page. When i try to do this by turning off the Chained - option to off, my parent modal page stilll closes when the new modal page is opened by button click.
Do you have any suggestions on achieving this ?
Thanks in advance.