Introduction
Refreshing a table or report region with a button in Oracle APEX is a common requirement when building interactive, responsive applications. Whether you're updating a Classic Report, Interactive Report, or Interactive Grid, users often expect the data to refresh after performing an action—such as inserting, updating, or deleting a record—without needing to reload the whole page. In this post, you’ll learn how to configure a button to refresh a report region using dynamic actions, improving both performance and user experience.
To refresh a table (typically a report region) with a button in Oracle APEX, you can use a Dynamic Action that triggers a Refresh on the specific region. This method avoids a full page reload and provides a seamless experience for the user, especially after data changes such as inserts, updates, or deletions.
Here is a step-by-step guide to implement this:Step 1: Create Your Report Region
-
In the APEX App Builder, open your application and navigate to a page.
-
Create a Classic Report, Interactive Report, or Interactive Grid region based on a SQL query.
For example:SELECT * FROM TASKS ORDER BY CREATED_DATE DESC
-
Give your report region a recognizable Static ID.
-
Click on the report region in Page Designer.
In the Advanced section, set the Static ID to something like
task_report
.
-
Step 2: Add a Button to the Page
-
In Page Designer, click the region where you want the button to appear (above or below the report).
-
Click the ➕ icon and select Button.
-
Set its label to something like
Refresh Table
. Set a Static ID for the button (optional but helpful), such as
refresh_btn
.
Step 3: Create a Dynamic Action to Refresh the Report
-
In Page Designer, under the Dynamic Actions section, click the ➕ icon.
-
Name it
Refresh Task Report
. -
Event: Select
Click
. -
Selection Type: Choose
Button
. -
Button: Select the name of your refresh button (
Refresh Table
or the exact name you gave it). -
Under True Actions, click the ➕ icon and choose
Refresh
. -
Affected Elements:
-
Selection Type: Region
-
Region: Select your report region (e.g.,
task_report
).
-
Save your changes.
Step 4: Run and Test
-
Run your application.
-
Perform an insert or any change in data (through a form or process).
-
Click the Refresh Table button.
The report will reload and display the updated data without a full page reload.
Optional: Add a Process That Modifies Data and Then Refresh
If you want the same button to perform an action (like insert) and then refresh the table:
-
Create a PL/SQL process (e.g., insert into
TASKS
) and tie it to the button using a Submit action. -
After submit, create a Dynamic Action on Page Load that refreshes the report region.
-
Or, use a Dynamic Action with two steps:
-
First Action: Execute PL/SQL Code (e.g., insert).
Second Action: Refresh the region.
-
Refreshing a table in Oracle APEX using a button involves assigning a Static ID to the report region and using a Dynamic Action to trigger a Refresh on click. This approach enhances the user experience by eliminating full-page reloads and updating data in real time. With just a few declarative steps, you can add dynamic interactivity to your reports and make your applications more responsive and modern.
The goal id to refresh a table after adding an entry to the table.
Step 1- Add a table region
Step 2 – Name the table
Step 3 – Select the table name
Step 4 – Add a second Dynamic Action to the button
Select The action: Refresh
Affected Elements
Selection Type: Region ( the report is a region)
Region: Newtable (the name of the report region)
Conclusion
Adding a refresh button to your APEX application is a simple but powerful way to provide users with real-time updates. By using dynamic actions to target specific report regions, you can avoid unnecessary page reloads and keep your interface responsive and modern. With just a few steps, you enable a smoother workflow that reflects changes instantly, making your APEX applications more intuitive and efficient.