cancel
Showing results for 
Search instead for 
Did you mean: 

How to place a loading gif before the load of a view?

Former Member
0 Kudos

Hi experts,

I am trying to place a loading gif before the load of a view, similar to fiori custom launch pad.

Accepted Solutions (1)

Accepted Solutions (1)

dunayevsky_yuri
Participant
0 Kudos

Why don't you just put it into your .html file?

Then, after the app is up, remove it or replace by the view.

Former Member
0 Kudos

ok, let me try it that way. So, first I have to place a busy indicator, and once its done, I have to remove it after the page loads up.

Former Member
0 Kudos

Hi,

Can u try like this

Ref : JS Bin - Collaborative JavaScript Debugging

Former Member
0 Kudos

Hi Pradeep, I suppose,here the coding is done for loading too.I suppose, there are pre built functions for this too, like sap.m.busyindicator and sap.ui.commons.prgressindicator. Can you help me in implementing using these?

Former Member
0 Kudos

Hi,

1.Write this code in your HTML page:

               <script>

                    var oBusyDialog=new sap.m.BusyDialog("oBusyDialog");

                     oBusyDialog.open();

               </script>

2.And in your controller js:

          onAfterRendering: function() {

                 sap.ui.getCore().getElementById("oBusyDialog").close();

         }

Try this

dunayevsky_yuri
Participant
0 Kudos

Maybe it is required to add the dialog to the page's content, like:

<script>

var oBusyDialog=new sap.m.BusyDialog("oBusyDialog");

oBusyDialog.placeAt("content");

oBusyDialog.open();

</script>

<body class="sapUiBody" role="application">

        <div id="content"></div>

</body>

because the dialog should be placed into some <div> tag on the page.

Former Member
0 Kudos

Thanks, Pradeep!!

Answers (3)

Answers (3)

saivellanki
Active Contributor
0 Kudos

Hi Sanjo,

If you're using a JS view, try like this on your createContent() method (below example shown using busy dialog control) -


var oGlobalBusyDialog = new sap.m.BusyDailog({title:"Processing..."});     //Create a Global BusyDialog

this.addEventDelegate({

     onBeforeShow:function(){

          oGlobalBusyDialog.open();        //Opens the busy dialog on before show of view

}

     onAfterShow:function(){

          oGlobalBusyDialog.close();          //Closes the busy dialog on after show of view

}

},this);

If you're using XML view, same logic you can have it in onInit of controller. But instead of this, it will be this.getView();


Regards,

Sai Vellanki.

saivellanki
Active Contributor
0 Kudos

Hi Sanjo,


Go through this blog, you will get an answer to your question:

Regards,

Sai Vellanki.

Former Member
0 Kudos

hi,

I already checked all the help I could get from SCN, any solution  from your side?

Former Member
0 Kudos

Hi,

Check this link and try implementing the same,

SAPUI5 app loading indicator - easy way | SCN

Former Member
0 Kudos

hi,

I already checked all the help I could get from SCN, any solution  from your side?