Page 1 of 1

Spinner disappearance for cascaded services

Posted: Fri Jan 16, 2015 11:24 am
by Cody Blue

I have a sequence of services on a page, and each service is completed on success of prior one. The issue is that the loading spinner appears momentarily and does not stay on till the last of the services is successfully executed, causing user experience glitch.

As suggested here (https://getsatisfaction.com/apperyio/...) I have inserted showSpinner() on page show and add hideSpinner at the success of very last service, but this has no effect.

How can this be fixed?
Regards


Spinner disappearance for cascaded services

Posted: Mon Jan 19, 2015 4:15 am
by Yurii Orishchuk

Hi Cody,

Please use following JS code to invoke service on the service "success" event.

pre

var onDelay = function(){
//Where "restservice1" is your service datasource name.
restservice1.execute();
};

window.setTimeout(onDelay, 1);

/pre

Also - don't forget to remove code you wrote before for this goal.

Regards.


Spinner disappearance for cascaded services

Posted: Mon Jan 19, 2015 7:43 pm
by Cody Blue

Hi Yurii,

This is a clever solution. However, I am noticing discontinuity especially when tested on device and it is more severe under poor network connectivity scenarios: i.e, a spinner appears and disappears and the next one appears and disappears and so on. Is there a more seamless way to handle this issue?

Regards.

PS - I don't think this influences the case in hand, but the scenario I have more specifically uses your recommendation as below:

// the following executed on success of restService0

code
setTimeout(function() {onDelay(data);}, 1);

function onDelay(data){
//some code here

if (boolean)
restservice1.execute();
else
restservice2.execute();
}

/code


Spinner disappearance for cascaded services

Posted: Wed Jan 21, 2015 10:15 am
by Ihor Didevych

Hi Cody,

1) You can attach your own progress bar
2) Please try to override existing progress bar with your function

Since you know how long is the chain, you can trigger filling progress


Spinner disappearance for cascaded services

Posted: Wed Jan 21, 2015 6:35 pm
by Cody Blue

Hi Ihor,

I had gone through elaborate discussion here regarding overriding, and was advised to instead use showSpinner() and hideSpinner() functions to achieve what I want:
https://getsatisfaction.com/apperyio/...

Unfortunately this does not work in that the spinner is not invoked and closed on demand with these two functions.

How do you suggest I achieve what your are suggesting?


Spinner disappearance for cascaded services

Posted: Wed Jan 28, 2015 8:49 am
by Evgene Karachevtsev

Hello Cody,

We are very sorry for delay, we are working on your request and try to post and update later today.


Spinner disappearance for cascaded services

Posted: Wed Jan 28, 2015 6:54 pm
by Ihor Didevych

Hello,

showSpinner is function only. If you open console and write it and run it you will see
http://gyazo.com/f007f98ac905d6a90e59...
this means that you can override it like any other functions

showSpinner = function(){
/// place your spinner here
}