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

Re: oData to JSON conversion - not working

$
0
0

Not sure where you call the 4 lines, but I assume they are never called because of the asynchronous nature of getting the data from your service?

 

You should wrap those 4 lines in a function which is then called from the success handler of your ODataModel:

 

var that = this;

 

oModel.read("/", null, null, true, function(oData, oResponse) {

  that.storeData(oData);

}, null);

 

storeData : function(oData) {

  oBaseModel.setData(oData);

  jQuery.sap.require("jquery.sap.storage");

  var oStorage = jQuery.sap.storage(jQuery.sap.storage.Type.local);

  var oBaseData = oBaseModel.getData();

  oStorage.put("BaseData", oBaseData);

}


Viewing all articles
Browse latest Browse all 3458

Trending Articles



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