Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3523

Define several OData models asynchronously

$
0
0

Hello,

 

I try to define several OData model asynchronously.

 

Here how I define them (all OData models declarations are grouped in a separate function):

 

var oODataModel = new sap.ui.model.odata.ODataModel(  "url1", {  loadMetadataAsync: true  }).attachMetadataLoaded(function(){  that.getView().setModel(oODataModel, "model1_odata");  });
oODataModel = new sap.ui.model.odata.ODataModel(  "url2", {  loadMetadataAsync: true  }).attachMetadataLoaded(function(){  that.getView().setModel(oODataModel, "model2_odata");  });


and so on.


The problem is that further in code I need to call to those "modelX_odata" models and do reads, while the models are still not set (async calls are still in progress).


Is there a way to wait for all those models are complete calls and are set?


Thank you,

Yuri



Viewing all articles
Browse latest Browse all 3523

Trending Articles



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