Hiding the Loading Indicator.

Forum to discuss the new web client version of Servoy.

Hiding the Loading Indicator.

Postby jay.rao » Tue Jan 23, 2018 7:38 am

Hello,

I want to hide the default servoy Loading Indicator from backend once my error is logged on my view. I see the document where it suggests to use $sabloLoadingIndicator but how can I hide it from my backend because I don't see anything like that in plugins.
https://wiki.servoy.com/display/DOCS/St ... e+NGClient
Please suggest.
Thanks
jay.rao
 
Posts: 59
Joined: Mon Apr 10, 2017 1:32 pm

Re: Hiding the Loading Indicator.

Postby paronne » Tue Jan 23, 2018 10:59 am

Hi,

the $sabloLoadingIndicator is a client-side Angular service. The wiki here describes how the service could be overriden to display for instance a loading dialog rather than a loading indicator. Is not what you are looking for.
This service is purely a client-side thing, therefore you can't call it from our default plugins; unless you make your own web-service plugin which calls the $sabloLoadingIndicator.

Anyhow Servoy automatically takes care to show/hide the loading indicator while is processing something, you should not proactively show/hide the loading indicator your self; therefore what is exactly your problem ?
You say: "i want to hide the loading indicator once the error is logged on my view"; what this exactly mean ? once the method execution is completed, doesn't the loading indicator already hides itself ?

Regards,
Paolo
paronne
 
Posts: 109
Joined: Fri Nov 02, 2012 3:21 pm

Re: Hiding the Loading Indicator.

Postby jay.rao » Tue Jan 23, 2018 12:39 pm

Hello,

Yes I understand your point, actually we had created custom loader
Code: Select all
angular.module('myModule').factory("loadingIndicator",function($window)
{
    return {
         showLoading: function() {
          if($('#loader-ele').length<1){
             var $div = $('<div />').appendTo('body');
            $div.attr('id', 'loader-ele')
          }
         
            $('#loader-ele').addClass('custom-loader');
           },
           hideLoading: function() {
               $('#loader-ele').removeClass('custom-loader');
           }
    }
})


which shows a custom spinner, but once we show the error to user the spinner still keeps on spinning and doesn't hide automatically. So I was of thinking on manually hiding it once we show the error popup to the user.In the attachment you can see our custom spinner and an error popup.
error1.PNG


"once the method execution is completed, doesn't the loading indicator already hides itself ?"
Yes it doesn't hide, although my execution is already completed and I don't see any breakpoints.
You do not have the required permissions to view the files attached to this post.
jay.rao
 
Posts: 59
Joined: Mon Apr 10, 2017 1:32 pm

Re: Hiding the Loading Indicator.

Postby paronne » Tue Jan 23, 2018 2:28 pm

"once the method execution is completed, doesn't the loading indicator already hides itself ?"
Yes it doesn't hide, although my execution is already completed and I don't see any breakpoints.


I see, what happens if you don't override the default loader indicator and you use the default loader instead ? Does also the default loader indicar remains visible despite nothing is being executed in the mean-time ?
Have you tried to debug your service, for instance placing an console.log("i am hiding " + new Date()) into the hideLoading function to see if the function is actually being called at all ? (the log message would show up in the browser).

I believe you could still make your own web service which pro-actively calls the loading indicator hideFunction, however, in case you can reproduce the issue also with the default loader indicator, sounds to be a better idea to create a case in our https://support.servoy.com with a sample solution.

Regards,
Paolo
paronne
 
Posts: 109
Joined: Fri Nov 02, 2012 3:21 pm

Re: Hiding the Loading Indicator.

Postby jay.rao » Tue Jan 23, 2018 3:09 pm

Hello,

I tried the same thing with servoy's default cursor and its the same behaviour i.e. spinner doesn't hide. I am attaching an image for the reference.

"I believe you could still make your own web service which pro-actively calls the loading indicator hideFunction"
. I would look into this approach

in case you can reproduce the issue also with the default loader indicator, sounds to be a better idea to create a case in our https://support.servoy.com with a sample solution.
. I would have to look how to create an exact sample for your reference.
I would also like to inform that this thing occurs only in some of the scenarios and not everytime. For e.g if I have some error related to database fields ,my spinner works just fine but in the current situation the spinner didn't work as expected.
Thanks for the suggestion.
ezgif.com-video-to-gif.gif
You do not have the required permissions to view the files attached to this post.
jay.rao
 
Posts: 59
Joined: Mon Apr 10, 2017 1:32 pm

Re: Hiding the Loading Indicator.

Postby paronne » Tue Jan 23, 2018 3:16 pm

I would also like to inform that this thing occurs only in some of the scenarios and not everytime


indeed i expected this to happen only in some specific scenario, that's why a sample solution is necessary to look into it.

"I believe you could still make your own web service which pro-actively calls the loading indicator hideFunction"

. I would look into this approach


I have never tried before but i guess you should try to inject, using the angular module injection, the loadingIndicator or the ($sabloLoadingIndicator) into your new web service and call the hideLoading function.

But again, i reccomend to create an issue in our support system rather than workaround the problem yourself.
paronne
 
Posts: 109
Joined: Fri Nov 02, 2012 3:21 pm


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 1 guest