Search code examples
oracle-apex

How can I close the second modal dialog and automatically return to the first modal dialog without reloading the entire page?


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?


Solution

  • Have a looked at the "chained" property of the second modal.

    enter image description here

    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)