Introduction:
This post talks about how to create a custom Alert box and use it for the complete application in the Oracle APEX.
Procedure:
To display Error/Warning message on runtime, we can simply use alert() method. But the obstacle in the alert() method is, its look and feel will be very basic and we cannot add the customization like adding CSS properties. To do any customization in the alert box then follow the steps given below,
- Create a HTML Report region and assign a static ID as alert.
- Navigate to the Custom attributes and place the below CSS,
style=”display:none;font-size: 20px;text-align: center;”
- Create a button named as Alert in the target page and modify the button action to “Defined by Dynamic Action”.
- Then create a Dynamic action as following,
Event : Click
Type : Button
Button : Alert
Action : Execute JavaScript Code
Code :
$(“#alert”).html(‘<i class=”fa fa-exclamation-triangle” style=”color: #FFBF00;font-size: 20px;”></i> Warning Message’);
$(“#alert”).dialog({modal:true,resizable: false,minHeight: 105,width:380,dialogClass: ‘testclass’});
This post uses the html and little jQuery to achieve creating custom alert box.
Call To Action:
For Oracle apex development and customization please do contact our company website https://doyensys.com/
Conclusion:
This post enables to add the CSS properties for the messages shown to the users.