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.
To implement this type of Dynamic Action, you need to create two separate Dynamic Actions:
- Defining the Custom Event
- 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:
Create a Dynamic Action and Set the Event Type to "Custom"
- 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.
Comments
Post a Comment