Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 2812

Problem with using sap.m.MessageBox

$
0
0

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.


Viewing all articles
Browse latest Browse all 2812

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>