on 03-21-2017 6:10 PM
I'm using ODataModel.read to access data from a service,
Following is the code :
var text = "800003886";
var sPath="/OverviewDeliveryDetailSet(IDelivery='"+text+"')";
var oModel = this.getView().getModel();
oModel.read(sPath , null , null , false ,
function(oData, oResponse){
console.log("msg"); },
function(error){
console.log("msg");
} );
Try writing the read function as below:
var fnSuccess = function(oData, oResponse) {
console.log("msg");
};
var fnError = function(error) {
console.log("msg");
};
oModel.read(sPath , {success: fnSuccess, error: fnError});
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try the below code:
oModel.read(sPath, {
success: function(oEvent){
// you will get data in oEvent
}.bind(this)
});
Best Regards,
Mahesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If a 4th argument value false is for a async, it should be true.
If a synchronous, a callback could not be called.
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.