Skip to Main Content
Feature Request FR-4659
Product Area Page Components
Status CLOSED

1 Voters

Dynamic Action: Invoke Ajax Callback (Promise‑aware, Bind‑aware, with Typed Response)

ld.diaz Public
· Sep 21 2025

Idea Summary
Add a native Dynamic Action (DA) to APEX that invokes an Ajax Callback and awaits its Promise before continuing. The DA should let developers map inputs (items/session values) to the request, await the response, and consume iteither in JavaScript (as an object) or by writing back to PL/SQL/session state—all declaratively, without custom wrappers. This closes a common gap currently solved with custom JS or third‑party plugins.

Problem

  • Today, calling apex.server.process/Ajax callbacks from a DA often requires custom JavaScript, manual Promise/thenhandling, and ad‑hoc error/timeout logic.
  • Chaining DA steps that depend on the response (e.g., populate items, conditionally refresh regions) is cumbersomeand error‑prone.
  • There is no declarative contract for payload → PL/SQL and PL/SQL → response (JSON), nor built‑in retry/backoff, debounce, cancel previous, or instrumentation.

Objectives

  1. Provide a first‑class DA action to invoke an Ajax callback and await completion.
  2. Enable declarative request/response mapping (items ↔ JSON ↔ PL/SQL record).
  3. Support error handling, timeout, debounce/throttle, cancel previous, and retry with backoff.
  4. Expose response to subsequent DA steps and to client code (JS), and allow server write‑backs (session state/items).
  5. Deliver telemetry and consistent security (CSRF, allowlist of processes).

Use Case

  1. Populate Items and Refresh Region: User selects an order, DA calls Ajax process to fetch summary, waits for response, populates customer/total items, and refreshes a region only if success=true.
  2. Client‑side Logic: Ajax response includes a directive (nextStep=CONFIRM), consumed in a subsequent JS DA step that shows a confirmation dialog.
  3. Search‑as‑You‑Type: Text field invokes Ajax callback with debounce (300ms) and cancel‑previous enabled, preventing request pile‑ups.
  4. Error Recovery: Ajax callback fails due to network; DA retries with backoff, shows declarative error message if all attempts fail.

Preferred Solution (Optional)

Goal: Provide a native, promise-first DA to invoke Ajax callbacks with declarative mapping, robust flow control, and built-in observability/security.

Core Decisions

  • Action Name: Invoke Ajax Callback.
  • Promise-first: DA execution awaits completion; exposes this.response / apex.da.response() to subsequent steps.
  • Declarative mapping: Items/JSON/PLSQL record mapping both ways; optional write-back to session state.
  • Flow controls: Cancel previous, debounce/throttle, timeout, retry with backoff, and error hooks.
  • Branching: JSONPath evaluation to drive True/False branches and conditional refresh.
  • Security: Allowlist of processes/sources, CSRF handled, optional HMAC payload signature.
  • Telemetry: Counts, p95 latency, bytes, retries/cancellations; Dev Toolbar mini-log.
  • UX: Tabs for Request, Await/Flow, Response, Errors/Retry, Security, Telemetry; test console.
  • Compatibility: Opt-in; built over apex.server.process, no breaking changes.
We reviewed this idea carefully, and while it was interesting, we concluded that due to all the internal implications we need to take into account, it is unlikely to make its way into APEX.

Comments

Comments

  • vincent morneau Admin OP 6 months ago

    Hi @ld.diaz thanks for sharing several ideas recently. We’re noticing more proposals that appear to be AI-generated or AI-assisted, including this one. While that’s not necessarily a problem, it often makes the ideas harder to evaluate and turn into actionable steps. This particular idea of yours makes broad claims across multiple APEX components, which makes it unactionable at this stage. If you’d like, please consider refining and refocusing your idea in a human-written reply so we can better assess it.

  • ld.diaz OP 6 months ago

    @vincent morneau  Thank you very much for your prompt response. The idea was proposed by a person and reorganized by AI. This idea is completely viable. Today, this idea is implemented in this plugin https://github.com/lddia/invoke_ajax_callback, but unless it is native, it is difficult to maintain it in a suitable form for future Oracle Apex upgrades.

  • vincent morneau Admin OP 6 months ago

    No doubt the idea is viable. Reviewing dozens of ideas per week has allowed us to quickly identify AI generated ones. Again there is nothing wrong having AI organize thoughts, but this one seems particularly scattered and I think the essence of your idea is lost. For example:

    Telemetry: Counts, p95 latency, bytes, retries/cancellations; Dev Toolbar mini-log.

    What does that mean and what is expected from APEX in context of the rest of the idea? Was that part of your original prompt? I think it's better for ideas to stay focused with a clear goal and use case. AI tends to transform a 100 words idea into a 1000 words idea, and the end result for the triage team is that we don't know how to make it actionable anymore.

  • ld.diaz OP 6 months ago

    In this section, we propose to view the traceability of requests made through open telemetry for dynamic actions using the AJAX Callback request. This is one of the reasons why we reorganized the Idea with AI, so that any idea we propose meets the standards of the latest version of Oracle Apex. We have a context template to reorganize this.