Fade Out Alert Message In Oracle Apex
The fadeOut() method gradually changes the opacity, for selected elements, from visible to hidden (fading effect).
Note: Hidden elements will not be displayed at all (no longer affects the layout of the page).
Syntax: $(selector).fadeOut(speed)
speed | Optional. Specifies the speed of the fading effect. The default value is 400 milliseconds
Possible values: · milliseconds · “slow” · “fast” |
Technologies and Tools Used
The following technology has been used to achieve the expected output.
- JavaScript
Use Case
In oracle apex when users click the save or update button they will get the alert message. That alert message will not close or fade out until the user closes that alert message. In this document, we are going to view how we can fade out the success message while saving the data in the oracle apex application.
This document explains how to achieve this requirement.
Architecture
Following steps explains in detail,
Step 1:
We need to get the class id for the alert success message.Normally this will be
.t-Body-alert .t-Alert
Step 2:
We need to copy paste the below JavaScript code in the Execute When Page Load option.
if(apex.message.TYPE.SUCCESS=’success’){
setTimeout(function(){ $(‘.t-Body-alert .t-Alert’).fadeOut(‘slow’); }, 2000);
};
For Report region Success Alert
Step 3:
We need to get the class id for the alert success message.Normally this will be
.t-Body-alert .t-Alert
Step 4:
We need to write the dynamic action for the click of the save option in the report tool bar.
For this we need to find the class id of the report tool bar.Normally this will be,
.a-Toolbar
We need to create dynamic action as below,
Step 5:
We nee to copy paste below code in execute JavaScript code option in dynamic action,
if(apex.message.TYPE.SUCCESS=’success’){
setTimeout(function(){ $(‘.t-Body-alert .t-Alert’).fadeOut(‘slow’); }, 2000);
};
Output:
By using the JavaScript in the dynamic action we can achieve this fadeout function in oracle apex.