on 06-18-2015 5:58 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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.
Dear DURAI VENKATESH,
It's strange, Why it's not working on onInit(). can you show the code, which is cause error.
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
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);
});
},
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
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();
What is line 147?
Regards, Mike
SAP Technology RIG
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.