cancel
Showing results for 
Search instead for 
Did you mean: 

Setbusy not executing...

former_member239819
Participant
0 Kudos

I have setBusy exucuted elsewhere in my application, but why not here.......



_onRouteMatched: function (oEvent) {

   //initialise display
   var view = this.getView();
   view.setBusy(true);

   view.byId("shopInput").setValue("");
   view.byId("effectiveDateFrom").setValue("");
   view.byId("shop24Hrs").setSelected(false);
   view.byId("shopClosed").setSelected(false);
   view.byId("createNext").setVisible(false);
   view.byId("createSubmit").setVisible(false);
   //view.byId("createSave").setVisible(false);

  // initialise the store view model
   var oModel = this.getModel("site");

   this.getModel().read("/SiteSet", {

   success: function (oData) {

   var oSiteData = oModel.getData();
   oSiteData.Sites = oData.results;
   oModel.setData(oSiteData);
   }.bind(this)

  });
   view.setBusy(false);

},

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member185414
Active Contributor
0 Kudos

Hi Adam,

If you want to release the busy state after the backend read was successful then use code as below.

The oModel.read calls are asynchronous and you need to set the busy indicator false in the success handler of this function.

_onRouteMatched: function (oEvent) {

   //initialise display

   var view = this.getView();

   view.setBusy(true);

   view.byId("shopInput").setValue("");

   view.byId("effectiveDateFrom").setValue("");

   view.byId("shop24Hrs").setSelected(false);

   view.byId("shopClosed").setSelected(false);

   view.byId("createNext").setVisible(false);

   view.byId("createSubmit").setVisible(false);

   //view.byId("createSave").setVisible(false);

  // initialise the store view model

   var oModel = this.getModel("site");

   this.getModel().read("/SiteSet", {

   success: function (oData) {

   var oSiteData = oModel.getData();

   oSiteData.Sites = oData.results;

   oModel.setData(oSiteData);

   view.setBusy(false);

   }.bind(this)

  });  

},

BR.

junwu
Active Contributor
0 Kudos

what are you talking....