Displaying a modal dialog for page item help

I wanted to be able to display a modal dialog containing a small report as help for an item.  This is easy to implement and can really customize and enhance the help displayed for an item.

First create your modal dialog page you want to display as help.  Make sure if this modal will be called from another modal that you set Chained Dialog to No for the modal help page.

On the page you want to call the modal help from, create a hidden page item to store the url.  Set the Source Type to PL/SQL Expression and in the Source value or expression enter the following code, replacing ’38’ with the page number of your modal help page:

apex_util.prepare_url('f?p=&APP_ID.:38:&SESSION.::NO:38:', p_triggering_element => '$(''body'')')

 

Add the following code to the Function and Global Variable Declaration of the page you will be call the help from:

function showHelp() {
 eval($("#PX_YOUR_PAGE_ITEM").val());
}

 

Last, for the page item you want to display help for, add the following code in the Post Element Text.  This will display the help button icon that you normally see when help is entered for a page item and sets the onClick for the button to the showHelp function:

<button class="t-Button t-Button--noUI t-Button--helpButton js-itemHelp" title="Help" aria-label="Help" tabindex="-1" type="button" onclick="showHelp()"><span class="a-Icon icon-help" aria-hidden="true"></span></button>

You can access the demo application here (credentials guest/demo): Modal Dialog Help Demo.