on 02-02-2016 11:51 AM
Hi,
I was making a read function for my oDatamodel, but after running my application i get this error when i check my console in Chrome:
The following problem occurred: no handler for data -
This is the function which contains the read function. For some extra information i am using the sap.ui.model.odata.v2.ODataModel for this application.
_downloadFile: function() {
var oModel = this.getView().getModel();
var selectedDocument = this.getView().getBindingContext().getObject();
var sRead ="/PDFSet(MyDocKey='',SCObjid='',AcadYear='',AcadPeriod='',Cokey='"+selectedDocument.Cokey+"',Cotyp='"+selectedDocument.Cotyp+"')/$value";
oModel.read(sRead, {
success: function(oData, oResponse){
console.log(".. oModel.read success: " + oData.results.length);
console.log(oData);
console.log(oResponse);
},
error: function(oError){
console.log(".. oModel.read failed");
var errorObj1 = JSON.parse(oError.responseText);
console.log(errorObj1);
}
});
}
I hope you can help me figure out what i am missing or doing wrong.
Kind Regards,
Arun
Hi,
You can find the root cause and some alternative ways in this Github issue - https://github.com/SAP/openui5/issues/3519
Regards,
Hao
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi everyone,
We have tried something else. We also tried using the jQuery.proxy, but still we get the
no handler for data message.
This is the function we made:
fSuccess : function(oEvent){
console.log(oEvent);
console.log("succes");
},
fError : function(oEvent){
console.log(oEvent);
console.log("error");
},
_downloadFile : function (){
var oModel = this.getView().getModel();
var selectedDocument = this.getView().getBindingContext().getObject();
var sRead = "/PDFSet(MyDocKey=' ', SCObjid=' ',AcadYear=' ', AcadPeriod = ' ', Cokey = ' " + selectedDocument.Cokey + "', Cotyp= '" +
selectedDocument.Cotyp + "' )/$value";
}
oModel.read(sRead, {
success : jQuery.proxy(this.fSuccess, this),
error: jQuery.proxy(this.fError, this)
});
},
When we run the the following will be shown in the console
and when we are debugging we see the following:
I hope you can help me solve this
Kind regards,
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arun,
Would you mind to put a breakpoint in the first line of the function and then check in which line it is throwing th error ?
Regards,
Gairik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arun,
Please try one of the following
1. Please pay attention to the details that parameter name "success" should NOT be used here
OR
2.This is call with the parameter names.
Hi Arun,
Have you tried calling the read function like below (2 null parameters for context and urlParameters):
Reference - SAPUI5 SDK - Demo Kit
oModel.read(sRead, null, null,
function(oData, oResponse){.....},
function(oError){....}
);
Regards,
Saurabh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.