cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Busy Indicator While loading SAPUI5 Application

Former Member
0 Likes
5,049

Hi All,

I have developed an SAPUI5 application. When i run the application it is taking more time to load.

i want to show a busy indicator during the loading process.

i cannot use a Sapui5 control as it is still not loaded ; can u please help me with some other option .

Thanks

Poornima.

View Entire Topic
padma_mundru
Participant
0 Likes

hi Poornima,

I think you need to place the busyIndicator in the first line of "onInIt()" function in your controller.js file .

or otherwise ,you use the busy Indicator in some case where your function is going to load and bind the data in the model to the view  here for your understanding i am adding some  sample code , so that you can able to understand

getItemsTap : function(oEvent){

  var supplierid = oEvent.getSource().data("id");

  var dialog = new sap.m.BusyDialog({

  text:'Loading Data...'

  });

  dialog.open();

  OData.read(

   "https://sapes1.sapdevcenter.com/sap/opu/odata/sap/ZGWSAMPLE_SRV/BusinessPartnerCollection('" + supplierid + "')/SalesOrders?$top=40&$format=json",

   function (data) {

   dialog.close();

   myData.Sales = data.results;

   oModel.setData(myData);

   }

  );

Try to understand the above code so that you can get it easily and let me know if you have any problem

Thanks&Regards

Padma Mundru

Former Member
0 Likes

Hi  Padma,

        Thanks for your reply.

       But i need show busy indicator before loading the SAP UI5 Application.

Thanks,

Poornima.

padma_mundru
Participant
0 Likes

Hi Poornima,

 

As per your requirement you have to define the busy indicator in init() function.

or otherwise follow the below code it may be helpful for you.


view:

onBeforeShow : function(oEvent) {

  this.getController().onBeforeShows(oEvent);

  },

Controller:

onBeforeShow: function(oEvent){

  // declare the busy indicator

  },