apex_add_dynamic_action
Adds a dynamic action to an Oracle APEX page, handling client-side events like click, change, or page load with actions (JavaScript, submit, show/hide, refresh, PL/SQL).
Instructions
Add a dynamic action (client-side event handler). Actions: execute_javascript, set_value, refresh, show, hide, submit.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| event | No | Triggering event: - "click": Button/element click (default) - "change": Item value change - "page-load": On page load (DOMReady) - "keydown": Key pressed - "custom": Custom jQuery event | click |
| da_name | Yes | Dynamic Action name. | |
| page_id | Yes | Page ID. | |
| sequence | No | Order of execution. | |
| plsql_code | No | PL/SQL for action_type="plsql" (TRUE branch). | |
| action_type | No | What the DA does (TRUE branch): - "execute_javascript": Run JavaScript code (use javascript_code param) - "submit_page": Submit the page - "set_value": Set an item value - "show": Show element - "hide": Hide element - "enable": Enable item - "disable": Disable item - "refresh": Refresh a region - "plsql": Execute PL/SQL (use plsql_code param) — runs via AJAX | execute_javascript |
| fire_on_init | No | Also fire when page first loads. | |
| javascript_code | No | JavaScript to execute (TRUE branch). Has access to apex.item(), apex.server.process(). | |
| trigger_element | No | Item name, button name, or jQuery selector that triggers the DA. Leave empty for page-level events (page-load). | |
| affected_element | No | Item or region name affected by the action (TRUE branch). | |
| false_action_type | No | Action type for the FALSE branch (same values as action_type). When provided, a FALSE branch action is created alongside the TRUE branch. Example: use action_type="show" and false_action_type="hide" for conditional show/hide based on a condition expression. | |
| false_javascript_code | No | JavaScript code for the FALSE branch (used when false_action_type="execute_javascript"). | |
| false_affected_element | No | Item or region name affected by the FALSE branch action. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |