Oracle APEX - Set Modal Dialog Title Based Upon Substitution Strings

Anton NielsenAnton Nielsen
1 min read

For more details, check out APEX Instant Tips episode 179.

In APEX Instant Tips episode 34 we discussed how to navigate the APEX DOM, specifically highlighting how to set a modal dialog title. That episode has one missed feature—with un-chained dialogs the solution set the title of all of the dialogs, not just the new dialog. It also required that you put JavaScript code on every page that required this feature.

A much better solution would be to have the page function like just about everything else in APEX—allow the title to simply use substitution strings. If the title is defined as

Details for &P123_FIRST_NAME.

Then when you open the modal dialog for Marwa Chouchene the page title should be

Details for Marwa

Of course, it does not behave this way by default. And Marwa didn’t like that at all. So what does an APEX expert do when APEX lacks a feature? She writes a plug-in!

Below is a link to Marwa’s plug-in.

https://github.com/ainielse/set-modal-title/

All you have to do is install the plug-in in your application and add it to Page 0 as an on-load dynamic action. Then, whenever you have a modal dialog title with a substitution string the plug-in will do take care of it.

0
Subscribe to my newsletter

Read articles from Anton Nielsen directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Anton Nielsen
Anton Nielsen