Dynamic Action in Oracle APEX – Event Scope Static vs Dynamic

Dynamic Actions in Oracle APEX has two important options for Event Scope being Static and Dynamic.

Static is chosen when your triggering element is a static item which is rendered on page load. Whereas if your triggering element is created after rendering of the page, Dynamic is chosen.

For example,

I have created a simple region and entered following html code to create a text item. I have also added a button in the region.dynamic-action-1

Next, I have created a dynamic action on the button click with Event as Execute Javascript to add new text elements dynamically to the Page.

dynamic-action-2

To see if the code works,

dynamic-action-3

Now I have created another Dynamic Action to print the values in the created text item onto the browser console. The event for this dynamic action is Key Release event of the text item and Event scope is Static.

dynamic-action-4

The action is Execute Javascript code and has entered the below code.

console.log($(this.triggeringElement).val());

 Now on the APEX screen, when I type any characters on the text item, the value will be printed on the console.

dynamic-action-5

As you can see, the dynamic action works only on the item which was rendered on Page load but not on the dynamically created items. This is because we chose Event Scope to be Static. For the dynamic action to work on the Dynamically created items, the event scope must be chosen as Dynamic.

dynamic-action

Now it works for both items. Other important use case for these Event Scope Static would be, when you want a dynamic action to act on the Interactive Grid rows which are present on the page load and not for the user created rows.

Please reach out to us for any APEX requirements at sales@sandbox.cittabase.com

Thanks for checking my blog …Have a nice day !!!!