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 a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Posted on 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 a comment
    10|10000 characters needed characters exceeded

  • Posted on 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


    endless.png (5.6 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 30, 2017 at 10:02 PM

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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on 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 a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.