Wednesday 15 July 2015

APEX 5 - Opening and Closing Modal Window

This example is showing how to open a Modal Page from any element in your application. It is easy to get it working using some standards like a button or a link in a report. However, it is not 100% clear how to get it working with some other elements which don't have the redirect functionality built in (item, region title, custom links, etc.). This example is also showing how to get the success message displayed on the parent page after closing of the Modal Page.

13 comments:

Sunil Bhatia said...

Hi Denes,

Can you provide me the code for showing success message, i.e. what actually is happening on Save click and Dialog Closed event.

Thanks

Denes Kubicek said...

Just updated that example page and extended it for that part.

Sunil Bhatia said...

Thank you so much.. worked :)

APEX Developer In the USA said...

Denes,
Great article.. But I have a different but similar situation.. I have a report page that I need to call a modal page with. User will either select a value on modal or cancel. If they select a value on modal I need them redirected to another page, passing through the selected value.

I have posted the example up on the forum, with access information if you have the time to look and offer any help..

https://community.oracle.com/thread/3874588

Denes Kubicek said...

Tony,

I see that the help came from Pavel. Is it now solved?

Regards,

Denes

APEX Developer In the USA said...

Whoops, You are right he did post a proper response. Users decided that modal looked weird..

Anonymous said...

Thanks. Works great. I have been messing around with this for a while, trying to get something like this to work. Tough to find good examples and documentation like this for Apex stuff. Excellent.

Anonymous said...

Hi Denes,

I tried this approach for BLOB item - File Browse (instead of DATE item), I cant make it work.

What do I need to change to make it work? (i.e. the new photo from the Dialog window is not being pass to the calling form)

THanks.

mikeT

Denes Kubicek said...

Mike,

just extended the example here to show it works also with file browse item for both, changing it and clicking on the search button:

https://apex.oracle.com/pls/apex/f?p=93000:404

Denes Kubicek

Paul Morinaka said...

Denes,

Nice example, but what if your calling page doesn't have an item to update and you just want to post a generic success message?

Thanks,
Paul

Krishna said...

How to open a modal page after submit of one page. First page is normal page but after submit, I need to use branching option to open a another page which is a modal page.

Unknown said...

Hello Denes, you provided example very useful for me.
Can you provide link to example page developer environment for detailed investigations.
I interested how you make Success message visible without branching page after closing dialog.

Denes Kubicek said...

Kiril,

provide your email please. Send me an email to

deneskubicek@yahoo.de

Regards,

Denes