I’m working on an Oracle APEX application where I have two modal dialogs. From the first modal, I open a second modal. What I need is to close the second modal and automatically return to the first modal without reloading the whole page, specifically when pressing the “Cancel” button.
I’ve been struggling with this, and I’m unsure how to configure the Cancel button to smoothly return to the previous modal. Does anyone know how to handle this with JavaScript or any other APEX functionality?
Have a looked at the “chained” property of the second modal.
If that is set to off, the modal will open in a new window (modal 1 will stay open) and the “Cancel Dialog” event in the dynamic action will only close the second modal. In a modal, the “Cancel” button should be defined by a DA with a single action of “Cancel Dialog” action.
If chained is set to “On”, the dialog will be seen as a single dialog and “Cancel Dialog” will close all dialog (that is how I understand it)
There are 2 aspects of this: First, the chained property of the modal pages as Koen already mentioned. Second one is how you redirect users to the modals.
For example I have a modal page: 3 and in this I have a button “Redirect”. “Redirect” button’s action is to “submit page” and in the processing I have a branch that goes to page 4 (second modal).
Given setup, even when the chained property of both pages are disabled, the cancel button on the page 4 cancels both modals.
The correct approach is: on “Redirect” button on page 3, set action to “redirect page in this application” and with the chained properties still disabled, your cancel button on page 4 should only close page 4.