Add an Icon next to an Item to Open a Modal (Or execute any other Javascript code)

Requirement


You want to add an icon next to an item to call an inline dialogue. Example if you want to create a custom select list, or advanced help, or (with an adaption) call another page.



Solution




In the post text field attribute of your item put this:

<a class="a-Button a-Button--popupLOV" href="javascript:apex.theme.openRegion('ICONS');"><span class="a-Icon icon-popup-lov"></span><span class="u-VisuallyHidden">"LIST_IMAGE_LOV_TITLE"</span></a>

You can replace the code after javascript to execute a script or call another page.

In my case I created a region of template type "Inline Dialogue" and with a static ID of ICONS.

Acknowledgement




Comments