Requirement: I have a button on my APEX page with the name as “Click to Reload Page“.
Now when user click on the “Click to Reload Page” button, it should reload or refresh the whole page.
Explanation on location.reload() function: The location.reload() method reloads the current URL, like the Refresh button.
The reload may be blocked and a SECURITY_ERROR DOMException thrown. This happens if the origin of the script calling location.reload() differs from the origin of the page that owns the Location object.
Solution: For solution of the above requirement follow the steps as shown below:
Step 1: Create a Region inside a page and set the Title as Reload Page
Step 2: Create a button inside the Region and set the below properties for the button.
- Name: P2_RELOAD_BTN
- Label: Click to Reload Page
Step 3: Create a Dynamic Action for the P2_RELOAD_BTN button and set the Name as reload_btn_clicked
Step 4: Set the Properties of the True outcome as shown below
- Code: location.reload();
Save and run the application. Thus, the ran application is shown below:
Click on “Click to Reload Page” button and with that the page will be reloaded or refreshed again.
Hence, the solution to our requirement.
Thanks & Regards,
1,964 total views, 4 views today