Page 1 of 2

Spinner not appearing

Posted: Sun Jun 30, 2013 12:07 pm
by Andrés Méndez

Hello.

I have one of the pages of my app which loads a REST service and receives a large JSON.

I have created the servicice as standard (not generic), so Appery must be loading the standard spinner (I suppose).

When using the app, the page loads and shows the header and footer, but needs about 5 seconds to show the content, and I would like that while the content is loaded, a spinner is shown.

As the spinner isn't shown, I have looked at the source code of the page.js, and I've seen that in the REST service it is used hideSpinner(), but no showSpinner().

So I think that the problem of the spinner not beign shown is that Appery doesn't call showSpinner().

Do I have to load the spinner manually? What do I have to do to show the spinner?

I've read this forum and I've read that you were thinking on disabling the spinner to let users use their custom spinner. If this is why the spinner isn't showing, what do I have to do to show the spinner?

Thanks.


Spinner not appearing

Posted: Sun Jun 30, 2013 4:20 pm
by Igor

Hello.

You have sent the similar question to a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a. I have answered via email.


Spinner not appearing

Posted: Sun Jun 30, 2013 5:28 pm
by Andrés Méndez

Hello Igor.

I tried to use a spinner by myself, but didn't work very well, but I don't remember asking anything about it to support.

I don't see any e-mail in my inbox about a spinner. If it was me who who made the question, can you resend me the e-mail please (because I can't find it and I don't remember it)?

Thanks in advance.


Spinner not appearing

Posted: Sun Jun 30, 2013 5:30 pm
by maxkatz

On what event do you invoke the service?


Spinner not appearing

Posted: Sun Jun 30, 2013 6:24 pm
by Andrés Méndez

On "Load".


Spinner not appearing

Posted: Sun Jun 30, 2013 10:24 pm
by maxkatz

Try with "page show"


Spinner not appearing

Posted: Mon Jul 01, 2013 5:24 pm
by Andrés Méndez

I invoke two services in the same page.

Using "Page show" to invoke both services the spinner appears but is never hidden :-(

I have removed one service and, invoking only one service with "Page show", shows the spinner and then hides it correctly. For the moment I can live with just one service, so for the moment my problem has been solved, thanks :-)


Spinner not appearing

Posted: Mon Jul 01, 2013 6:34 pm
by Kateryna Grynko

Hi Andrés,

On start screen Load event add the code below to override basic spinner call.

Then, after N consecutive calls showSpinner(); you would need to call N successive hideSpinner(); functions to hide it. Or one call for forced hide hideSpinner(true);

precodewindow.showSpinner = showSpinner;
window.hideSpinner = hideSpinner;
window.__spinner_show_count = 0;

window.showSpinner = function() {
window.showSpinner.apply( window, arguments );
return ++window.spinner_show_count;
}

window.hideSpinner = function( force ) {
window.spinner_show_count = (force ? 0 : (window.spinner_show_count > 0 ? window.__spinner_show_count-1 : 0) );

Code: Select all

 if ( window.__spinner_show_count === 0 ) { 
      window.__hideSpinner.call( window ); 
 } 
 return window.__spinner_show_count; 

}
/code/pre


Spinner not appearing

Posted: Tue Jul 02, 2013 6:12 pm
by Andrés Méndez

Thanks Katya! Next time that I need to services in the same page, I'll try it.


Spinner not appearing

Posted: Fri Jul 18, 2014 8:26 am
by Ahmad Al-Husseini

Hello, i'm having a problem implementing this code, i followed your instructions, and i called the showspinner(); on page show, but it never hides, should i also call the hidespinner(): as well for the same page