在我SAPUI5的應用程序,我有這應該在等待的OData模型.create()
服務的響應(因爲它需要一段時間才能得到響應回到UI)運行進度指示器作出了動畫。如何製作異步OData .create()請求?
的問題是,.create()
請求發送動畫後停止。
有誰知道如何使一個異步.create()
OData的要求嗎?
我的代碼如下所示:
oODModel = new sap.ui.model.odata.ODataModel(myUrl);
oEntry = myNewDataEntry;
myAnimationIndicator.start(); //animation starts to run
var onSuccess = function(){myAnimationIndicator.stop();};
var onError = function(){myAnimationIndicator.stop();};
oODModel.create('myDataSet',oEntry, null, onSuccess, onError); //From here the animation stops
不應該路徑是'/ myDataSet'? –
創建異步使用批而不是創建(),請參閱https://openui5.hana.ondemand.com/docs/api/symbols/sap.ui.model.odata.ODataModel.html#createBatchOperation –