Search code examples
javascriptoracleoracle-apexlov

How to include javascript file into LOV popups on apex oracle?


I want to include .js file (or piece of code) into LOV popups of some apex page. I found that I can't do that in apex IDE for editing LOV popups and I can only include .js file into apex page. Question: how to include it into LOV popups of some page, is there any way to do that?


Solution

  • If you have a custom theme, you can easily add some javascript to all popup LOVs by editing the "Popup LOV" template for your theme. Go to Shared Components > Templates, search for "LOV", and edit the default one for your theme. At the bottom, you can edit the page header HTML and add a <script> tag to put your javascript in.

    If you're still using a standard theme (and you don't want to unsubscribe it to create a custom one), you can add javascript file URLs at the application level. Click Edit Application Properties > User Interface > click the Edit button next to your theme > JavaScript. Upload your javascript code as a .js file to your server, put the URL in the "File URLs" box, and it'll be loaded on every page in the application. If you only want your code to run on Popup LOV windows, you'll need your js to check for some CSS class that only exists on Popup LOV pages, e.g. body.t-Page--popupLOV.

    There are probably other ways to do it, too.