Skip to Content
0
Aug 10, 2015 at 09:16 AM

sap.m.message box onClose is not working

3904 Views

hi i am trying to display a message box and based on action on message box it should undergo the condition.

jQuery.sap.require("sap.m.MessageBox");
sap.m.MessageBox.show(
"Please Confirm to Submit", {
icon: sap.m.MessageBox.Icon.INFORMATION,
title: "Dear User",
actions: [sap.m.MessageBox.Action.YES, sap.m.MessageBox.Action.NO],
onClose: function(oAction){
if(oAction == "YES"){var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
oRouter.navTo('default');}

},
}
);

here i am trying to navigate to another view if i select YES button in message box.but it is not happening.can u help where i went wrong?