Dear Experts,
Do you see any reason the below code may not work and give the following errors in red ?
Uncaught TypeError: Cannot read property 'confirm' of undefined
Uncaught TypeError: Cannot read property 'alert' of undefined
//Source code
var oButtonConfirm = new sap.m.Button("idButtonConfirm", {
text : "Confirm",
icon : "sap-icon://accept",
press : function()
{
sap.m.MessageBox.confirm("This message should appear in the confirmation", {
title: "Confirm", // default
onClose: null, // default
styleClass: "", // default
initialFocus: null, // default
textDirection: sap.ui.core.TextDirection.Inherit // default
});
}
});
//Source code
var oButtonAlert = new sap.m.Button("idButtonAlert", {
text : "Alert",
icon : "sap-icon://alert",
press : function() {
sap.m.MessageBox.alert("This message should appear in the alert", {
title: "Alert", // default
onClose: null, // default
styleClass: "", // default
initialFocus: null, // default
textDirection: sap.ui.core.TextDirection.Inherit // default
});
}
});
Regards,
AG.