Custom JavaScript event of Dynamic Action in Oracle APEX

In some scenarios, predefined events of Dynamic Actions (DA) may not meet your specific requirements. Custom JavaScript Events allow you to define and trigger events tailored to your application needs.

I recommend watching the video on my YouTube channel (www.youtube.com/@LidaGholizadeh_ORACLE_GISfor more details about this article!




To implement this type of Dynamic Action, you need to create two separate Dynamic Actions:

  1. Defining the Custom Event
  2. Triggering the Custom Event

Let’s dive into the details step by step.

Step 1: Define the Custom Event

To define a custom event, follow these steps:

  1. Create a Dynamic Action and Set the Event Type to "Custom"

     
Here Selection Type determines which elements or scope the custom event applies to and you have these option
  • Item(s): Triggered by one or more page items.
  • Button: Triggered by a button.
  • Region: Triggered by a region.
  • Column(s): Triggered by one or more columns.
  • jQuery Selector: Triggered by elements selected using a jQuery selector.
  • JavaScript Expression: Triggered by elements returned by a JavaScript expression


If you select JavaScript Expression as the Selection Type you should Enter a valid JavaScript expression that evaluates to a single DOM object. for example, document returns a reference to the browser's document object and When you use document it as the JavaScript Expression, the custom event will be globally available across the entire document, making it accessible anywhere in your application.

Step 2: Triggering the Custom Event

Now you created your Custom Event. To use that you need to run a JavaScript to trigger this event.for example, create a button and then create a DA for that to run a JavaScript for triggering your Custom Evenet.



        apex.event.trigger(document'myCustomEvent');




 

Comments

Popular posts from this blog

JavaScript In Oracle APEX (Client Side)

Installation of Oracle Database 23ai and APEX 24.2 and ORDS 24.4 on Windows Step-by-Step

Building a Fully Local AI-Powered Assistant with Oracle APEX and Vector Search #APEXCONN2025 #orclAPEX

Configuration of ORDS: Standalone, Tomcat, and WebLogic on Windows Step-by-Step

✔ RTL Map Region Labels APEX 24.2 & 🌍GeoCoding

Building an AI-Powered Resume Matching System Using Oracle APEX and 23ai Vector Search😎

Oracle JET and Oracle APEX are best friends💕

Vector Tiles in Oracle Spatial 23

What is SYS.ODCI (SYS.ODCINumberList or SYS.ODCIVarchar2List) and How Can Use it in APEX ?

My Experience at Oracle CloudWorld Tour in Frankfurt – April 10, 2025