Skip to Content

sap.m.MessageBox.show on close is going endless without control

Hi

I have a scenario, where I need to display the message , I can able to successfully display the message but the control is not coming back to the screen as it is going as loading the program.

Please find the code.

sap.m.MessageBox.show("Please enter your user-ID instead of email-id", {

icon: sap.m.MessageBox.Icon.NONE,

title: "", actions: sap.m.MessageBox.Action.YES,

onClose:function(oAction) {

if (oAction === sap.m.MessageBox.Action.YES) { this.loadDisplayMode(Email); }

}

thanks

Vijay

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Aug 30, 2017 at 01:20 PM

    Hi Vijay,

    I think, your function, this.loadDisplayMode(Email); is not getting called, as "this" will return the MessageBox object.

    Please try the below code.

    var that = this;
    sap.m.MessageBox.show(
    sMessage, {
    icon: sap.m.MessageBox.Icon.NONE,
    title: "",
    actions: sap.m.MessageBox.Action.YES,
    onClose: function(oAction) {
    if (MessageBox.Action.YES === oAction) {
    that.loadDisplayMode(Email);
    }
    }
    }
    );

    Regards,

    Vikas Trivedi

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 30, 2017 at 01:30 PM

    HI Vikas,

    thanks for your reply and it did not work. I have attached the screenshot as well.

    Thanks
    vijay

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 30, 2017 at 10:02 PM

    somewhere in your code, you have the busy state turn on...

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 31, 2017 at 02:41 AM

    In you code, there were some minor JS errors. I fixed and tried; it works.

    Check the attached screenshot. Your code snippet is:

    			showTextInfo: function(oEvent) {
                            var that = this;
    			sap.m.MessageBox.show("Please enter your user-ID instead of email-id", {
    			   icon: sap.m.MessageBox.Icon.NONE,
    			   title: "", 
    			   actions: sap.m.MessageBox.Action.YES,
    			   onClose:function(oAction) {
    			   if (oAction === sap.m.MessageBox.Action.YES) { 
    				that.loadDisplayMode(); 				
    			  }
    			}
    			});
    

    Add comment
    10|10000 characters needed characters exceeded