1

I am a beginner to Oracle Apex and I am using version 19.1.

How do I create/use shared variables? I want to set/access them through different pages. I am not able to figure this out since everything is provided with an interface and not much access to the low level JavaScript code.

Littlefoot
  • 131,892
  • 15
  • 35
  • 57
Rutuja Kulkarni
  • 67
  • 1
  • 1
  • 5
  • What have you tried so far? – Murray Foxcroft Oct 14 '19 at 21:32
  • Hi Rutuja! You said, "not much access to the low level JavaScript code." I'm creating some content on "JavaScript for APEX Developers" and I'd love to know more about the problems you're having. Feel free to reach out to me via my blog or on Twitter (see my profile for links). – Dan McGhan Oct 15 '19 at 13:42

2 Answers2

3

In one sense, both page items and application items can be thought of as "shared" in that their values can be accessed in SQL and PL/SQL from anywhere.

However, if you want to set/access the values of page items through multiple pages using JavaScript, you should put those page items on page 0. Page 0 is a special page that adds content to all pages, so use the appropriate conditions to add the items to only the pages you need.

Dan McGhan
  • 4,479
  • 1
  • 11
  • 15
2

Either

  • go to Shared Components and create them there (see upper left corner), or
  • create a Global Page (Page 0) and in there create items which can be used throughout the application
Littlefoot
  • 131,892
  • 15
  • 35
  • 57