Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

BusyIndicator doesn't show immediately

Hi experts,     my busyIndicator doesn't show immediately,what's wrong with it? my code as follow:

var oModel = this.getView().getModel();

  oModel.attachRequestSent(function() {

  sap.ui.core.BusyIndicator.show(10);

  });

  oModel.attachRequestCompleted(function() {

  sap.ui.core.BusyIndicator.hide();

  });

  oModel.create("/HeaderSet", data, {

  async : true,

  success : function(oData, response) {

  if (response.data.PreqNo) {

  sap.ui.commons.MessageBox.alert("PreqNo: "  + response.data.PreqNo);

  }

  },

  error : function(oError) {

  sap.ui.commons.MessageBox.alert(oError.message);

  }

  });

always the busyIndicator shows when fired success function,what can I do for this?

thank you.

best regards,

felix.

Tags:
Former Member
Former Member replied

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);

  }

  });

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question