Wednesday 18 February 2015

Alert Function

In APEX you will probably use javascript alert function in many cases by saying:

alert ('some message');

The popup box you get looks a bit strange and outdated. As an alternative to this you may use this function call:

function get_alert (p_message,p_id) {$("<div/>", { "html":p_message}).attr({"title":"Error has occurred!"}).dialog({
modal:true,
buttons:{"Go to Error":function(){$(this).dialog("close");
$(p_id).select();}}
}); }


As you can see in this example, you can add additional functions to this alert box in order to do something after closing of the alert message. You can choose to display the alert as a modal window as well.



Enjoy.

No comments: