hi dennis,
it doesn't work,the busyIndicator shows about 7 sec later,finally,I use busyDialog,it seems good.
var _this = this;
if (!_this.busyDialog) {
_this.busyDialog = sap.ui.xmlfragment("cnooc.servpr.approve.view.BusyDialog", this);
this.getView().addDependent(_this.busyDialog);
}
jQuery.sap.syncStyleClass("sapUiSizeCompact", this.getView(), _this.busyDialog);
_this.busyDialog.open();
// Commit Data
var newModel = this.getView().getModel("new");
var data = newModel.getData();
var oModel = this.getView().getModel();
oModel.create("/HeaderSet", data, {
async : true,
success : function(oData, response) {
_this.busyDialog.close();
if (response.data.PreqNo) {
sap.ui.commons.MessageBox.alert(
"PreqNo: " + response.data.PreqNo);
}
sap.ui.commons.MessageBox.alert(
"Code: " + response.data.Code
+ " /nMessage: " + response.data.Message);
},
error : function(oError) {
_this.busyDialog.close();
sap.ui.commons.MessageBox.alert(oError.message);
}
});