cancel
Showing results for 
Search instead for 
Did you mean: 

Busy Indicator problem when i migrating from sapui5 to cordova android project

former_member198924
Participant
0 Kudos

Hi Everyone,

when i migrating from sapui5 to cordova android project. I'm gettiong the following error.

file:///android_asset/www/resources/sap-ui-core.js: Line 147 : Uncaught TypeError: Cannot call method 'open' of undefined

Accepted Solutions (0)

Answers (2)

Answers (2)

Private_Member_15166
Active Contributor
0 Kudos

Hi Durai,

Debug your code in chrome browser line by line and see on which line you are getting the error.

Regarding your error, it may be solved only if you explain us that what really you are doing. Maybe by sharing your code.

Regards

Dhananjay

former_member198924
Participant
0 Kudos

Hi Dhananjay Choubey,

This is my busy dialog code

var busyDialog = new sap.m.BusyDialog("loginMs", {customIcon : "images/backk.png" ,customIconHeight : "32px",customIconWidth :"32px"});

  busyDialog.open();

  busyDialog.close();

i declared this code in index.html page. when i try to call sap.m.BusyDialog that time. I'm facing the above mentioned error. could you please correct me.

santhu_gowdaz
Active Contributor
0 Kudos

Add this code in your view,

var busyDialog = new sap.m.BusyDialog("loginMs", {customIcon : "images/backk.png" ,customIconHeight : "32px",customIconWidth :"32px"});

and call from your controller,

var busyDialog = this.getView().byId("loginMs");

busyDialog.open();

  busyDialog.close();

former_member198924
Participant
0 Kudos

Hi Santhosh Gowda

when i click the button that time busy indicator is working fine. But when declare the busy indicator to init() function its not working it throw the following error

file:///android_asset/www/resources/sap-ui-core.js: Line 147 : Uncaught TypeError: Cannot call method 'open' of undefined

so what i understood on button click event sap.m.BusyDialog is working fine.




santhu_gowdaz
Active Contributor
0 Kudos

Dear ,

It's strange, Why it's not working on onInit(). can you show the code, which is cause error.

Private_Member_15166
Active Contributor
0 Kudos

Hi DURAI,

Perhaps you have defined your busydialog in view and you are accessing it in onInit method of controller.

Write like this to access the element id for busyDialog in onInit method.

var oBusyDialog = sap.ui.getCore().byId('loginMs');

oBusyDialog.open();

Check if this works.

Regards

Dhananjay

former_member198924
Participant
0 Kudos

Hi Santhosh,

This is my code. I'm declared BusyDialog() in index.html page globally.

// index.html

var busyDialog = new sap.m.BusyDialog("loginMessages", { customIcon : "images/loading.png" ,customIconHeight : "120px",customIconWidth :"120px"}); 

                busyDialog.open();

                busyDialog.close();

// Controller page

onInit: function() {

  busyDialog.open();

    var url2="http://Server ip:8081/sap/opu/odata/sap/ZG_Check_SRV/Divi4Set?$filter=ImL eq 'ind';

    var oMod2=new sap.ui.model.odata.ODataModel(url2,false,"username","password");

        oMod2.read('',null,null,true,function(oData,oResponse)

                {

   busyDialog.close();

               var oModelDivF4 = new sap.ui.model.json.JSONModel();

               oModelDivF4.setData(oData);

             

                });

},

Private_Member_15166
Active Contributor
0 Kudos

Hi Durai,

First access your busyDialog ID in INIT method.


onInit: function() {

var busyDialog = sap.ui.getCore().byId('loginMessages');

  busyDialog.open();

    var url2="http://Server ip:8081/sap/opu/odata/sap/ZG_Check_SRV/Divi4Set?$filter=ImL eq 'ind';

    var oMod2=new sap.ui.model.odata.ODataModel(url2,false,"username","password");

        oMod2.read('',null,null,true,function(oData,oResponse)

                {

   busyDialog.close();

               var oModelDivF4 = new sap.ui.model.json.JSONModel();

               oModelDivF4.setData(oData);

           

                });

},

Regards

Dhananjay

santhu_gowdaz
Active Contributor
0 Kudos

in index.html,

why these 2 lines of code.

busyDialog.open();

busyDialog.close();

Private_Member_15166
Active Contributor
0 Kudos

Hi Durai,

Write this piece of code in your view in place of index.html in createContent method.

       createContent : function(oController) {

var busyDialog = new sap.m.BusyDialog("loginMessages", { customIcon : "images/loading.png" ,customIconHeight : "120px",customIconWidth :"120px"});

                     }

after that access your ID in your Init method of controller by this code.

var busyDialog = sap.ui.getCore().byId('loginMessages');


and then write

busyDialog.open();

busyDialog.close();

agentry_src
Active Contributor
0 Kudos

What is line 147?

Regards, Mike

SAP Technology RIG