In this tutorial, I will show you how to create a dynamic action to submit a page in Oracle Apex.
In Oracle Apex, when we create a button or a button created by itself using the wizard for a form, it has the default behavior setting to
Submit Page and the database action
SQL Insert or
SQL Update accordingly.
We use this default setting usually, and there is no harm in it. But recently, I faced a scenario in which on click of the
Save button, a huge database transaction is happening in the background. While the transaction is happening, the Oracle Apex application page remains still without showing any processing status.
And due to this silent behavior, the user gets confused that if he clicked on the button or not, and he accidentally clicks multiple times, which causes the issues.
To prevent this, I tried to create a dynamic action to submit the page instead of using the default setting. And while creating this, I found some useful settings for it which solved this issue.
So if you struggling with a similar issue, check the following example of creating a dynamic action for the submit page action in Oracle Apex:
Creating Dynamic Action to Submit Page in Oracle Apex
Open your Oracle Apex application page and click on the button for which you want to create the dynamic action of submit page type.
Now do the right-click on that button and select Create Dynamic Action from the shortcut menu and set the following properties for the
- Action: Submit Page
- Request/Button Name: SAVE (your page button name)
- Show Processing: Yes (ON)
- Fire on Initialization: No (OFF)
In the above setting, the
Request / Button Name is the important property, do not miss to specify the button name; else it will not function properly.
Now set the following properties for the button SAVE:
- Action: Defined by Dynamic Action
- Execute Validations: Yes (ON)
- Database Action: Select as per your need.
After completing the settings, save the changes, and run the page to test.