Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Issue with Closing a Modal from another Modal - 21.2

Joe RFeb 3 2022

Version 21.2
Hello,
I have a page that is calling a Modal page. On that Modal page I have a button that calls a second Modal page. When closing the second Modal page either by clicking a "Cancel" button or a "Save" button I want that second Modal page to close and go back to the first Modal page.
I also have Javascript to warn on unsaved changes if the user edits the page but does not save it and tries to leave. I found this article to get this to work: http://rimblas.com/blog/2017/04/warn-before-closing-apex-modal-dialogs/
As it says in the article the Javascript to display the message is on the parent page in the Function and Global Variable Declaration.
When I'm on the second Modal and click "Cancel" button I get a Javascript error that the "warnOnClose" is not defined.
What I've tried:
On the first Modal I put the same Javascript that is on the parent page in the Function and Global Variable Declaration to display the message and the "beforeClose: warnOnClose" in the Dialog -> Attributes on the second Modal page.
What I want to have happen:
When on the first Modal and a change is made and the user tries to close the page without saving I want the message to display that there are "Unsaved Changes". When the page is closed it should return to the parent page.
When the second Modal is opened and a change is made and the user tries to close the page without saving I want the message to display that there are "Unsaved Changes". When the page is closed it should return to the FIRST Modal page.
The "Warn on Unsaved Changes" in the Navigation section does not seem to work on a Modal page. Also, the "Chained" is turned on in both Modal pages.
Can someone help me with this?
Please let me know if you have any questions.
Thanks,
Joe

Comments
Post Details
Added on Feb 3 2022
3 comments
913 views