Coding Duchess
Coding Duchess

Reputation: 6899

How to close modal dialog windows from javascript

I have a page from which modal dialog page gets opened. After page is opened, the user makes some selections and clicks on the button and some javascript gets executed. After it is done, I need to close the modal page. I tried window.close() but it did not work. How can I close the modal dialog page from javascript?

Upvotes: 3

Views: 17369

Answers (2)

Christian
Christian

Reputation: 11

I have rarely seen the documentation on the method below. I had to read a book to find out.

Try this:

redirect to URL:

javascript:closeModal();

You can also pass the modal parameter if necessary:

javascript:closeModal('P2_HELP_MODAL');

You can also open the same way:

javascript:openModal('P2_HELP_MODAL');

Upvotes: 0

romeuBraga
romeuBraga

Reputation: 2165

Try this:

apex.navigation.dialog.close(true)

https://docs.oracle.com/cd/E59726_01/doc.50/e39149/javascript_api.htm#AEAPI30096

Upvotes: 6

Related Questions