on 09-03-2017 6:11 PM
Dears,
I want to get entity set data to a variable using class "sap.ui.model.odata.v2.ODataModel" but always the variable value is undefined.
as I read OData v2 is loading data async but till now I don't have any clue how to load data into a variable.
//Creating the Model Instance
// "/destination/ODataTest" is defiended in my neo-app.json"
var oModel = new sap.ui.model.odata.v2.ODataModel("/destination/ODataTest/Northwind/Northwind.svc/");
var DataLoaded = oModel.read("/Products",
{success: function(){
MessageToast.show("Success");
}, error: function(e){
MessageToast.show("Failed");}
});
Thank you.
Hi,
You could use the below method to see if metadata is loaded, post which you can check if the data is getting binded to your controls.
oDataModel.attachMetadataLoaded(function(){
var oMetadata = oDataModel.getServiceMetadata();
});
Regards,
Ravikiran
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 | |
11 | |
10 | |
8 | |
8 | |
6 | |
6 | |
6 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.