Idea Summary
The proposal is to introduce a Execution Delay (ms) attribute directly within the Dynamic Action (DA) framework in Oracle APEX. Currently, if a developer needs to delay a True or False action (e.g., waiting for a CSS transition to finish or throttling a search widget), they must wrap their logic in a manual setTimeout JavaScript function.
This feature would add a "Timeout" or "Delay" field at two levels:
-
Dynamic Action Level: Applies a delay before any actions are executed.
-
Action Level (True/False): Allows granular control to delay specific actions within the sequence (e.g., Action 1 runs immediately, Action 2 runs after 300ms).
Use Case
This would be highly beneficial in scenarios where timing is critical but writing custom JavaScript reduces maintainability:
-
Search Throttling: Delaying a "Refresh" action on an Interactive Grid or Classic Report while a user is typing, preventing a server hit on every keystroke.
-
UI Synchronization: Waiting for a Modal Drawer to finish closing before refreshing the underlying parent region.
-
Visual Feedback: Allowing a "Success" message or animation to be visible for a few hundred milliseconds before navigating the user to a different page.
-
Race Conditions: Handling edge cases where a background process or session state set needs a brief moment to commit before a subsequent UI action triggers.
Preferred Solution
-
Metadata Enhancement: Add a numeric field Execution Delay to the APEX_APPLICATION_PAGE_DA_ACTIONS table.
-
Engine Logic: Update the APEX client-side engine (desktop_all.min.js or pe.js) to check for this attribute.
-
Implementation: * If the value is greater than 0, the engine wraps the action execution in a setTimeout.
- Ensure the "Wait for Result" attribute still respects this delay to maintain the synchronous flow of the action sequence.
-
Syntax Example: In the background, the engine would essentially transform the declarative action into:
JavaScript
// Internal APEX engine logic
setTimeout(function() {
apex.event.trigger(el, 'action_name');
}, delay_value_p);