Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to know if all dynamic actions are completed in oracle apex?

Szlanyinka ZoltánJun 19 2025 — edited Jun 19 2025

Hi Team!

It often happens that we bind all kinds of dynamic events to the elements in the form, and their behavior can depend on each other's values. Our users insist on providing shortcut keys to access the [Save] and [Create] buttons, e.g. [Ctrl Enter]. We have created several JS solutions, but basically the problem with all of them is that we cannot tell whether the change / other event handlers of the input field or additional items dependent on the input field have run.

this is a working solution, but it is uncertain due to the timeout:

document.addEventListener("keydown", function(event) {
  if (event.ctrlKey && event.key === "Enter") {
    event.preventDefault();
    const active = document.activeElement;

    if (!active || !["INPUT", "TEXTAREA"].includes(active.tagName)) return;

    active.addEventListener("blur", () => {
      setTimeout(() => {
        const buttons = document.querySelectorAll("#saveButton, #createButton");
        const visibleBtn = Array.from(buttons).find(btn => btn.offsetParent !== null);
        if (visibleBtn) {
          visibleBtn.click();
        }
      }, 200); // <---- timeout value
    }, { once: true });

    active.blur();
  }
});

It would be nice to have some JS support that clearly tells us whether we still need to wait for the DA-s to run.

Thanks
Z.

Comments
Post Details
Added on Jun 19 2025
2 comments
87 views