Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to access a javascript function from all app pages 18.2?

Eslam_ElbyalyNov 1 2019 — edited Nov 2 2019

Apex 18.2.

Hi,

- I have javascript pages that I need to reference from multiple pages in my app. I've seen another thread about Apex 5 that mentioned the following steps. And I used it but the browser console says the function is not defined.

  1. Put your JS code into a file
  2. Go to Shared Components -> Static Files and upload it
  3. Go to Shared Components -> User Interface Attributes -> Desktop -> Javascript
  4. Enter #APP_IMAGES#my_js_file.js into "File URLs" attribute

1- Why can not it see it?

2- Is this the best way to do so?

my.js file's content is,

function editIg(pIg){

    apex.region(pIg).widget().interactiveGrid("getActions").set("edit",true);

}

function deEditIg(pIg){

    apex.region(pIg).widget().interactiveGrid("getActions").set("edit",false);

}

I am referencing those functions from page attributes> JavaScript functions and global variables declaration attribute.

This post has been answered by John Snyders-Oracle on Nov 1 2019
Jump to Answer
Comments
Post Details
Added on Nov 1 2019
6 comments
1,984 views