Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9080

Re: Using Gateway to get service data to an ODataModel in UI5

$
0
0

Hi,

 

I am also disappointed by the lack of a .getData() method on an ODataModel Object.

The only workaround I've found is to build an JSONModel from the ODataModel.

 

Please try the following code:

 

var url = currentContext + "/CorpBudgetOpBudgetHeader/CorpBudgetOpBudgetLinesSet";                    var oModel = new sap.ui.model.odata.ODataModel(serviceUrl, true);                    var oModelJson = new sap.ui.model.json.JSONModel();                    oModel.read(url, null, null, false, function(oData, oResponse) {                              oModelJson.setData(oData);                    }, null);                    var data = oModelJson.getData();

 

Cheers


Viewing all articles
Browse latest Browse all 9080

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>