Andrés Méndez
Posts: 0
Joined: Thu Apr 18, 2013 6:13 pm

Spinner not appearing

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.

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

Spinner not appearing

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.

Andrés Méndez
Posts: 0
Joined: Thu Apr 18, 2013 6:13 pm

Spinner not appearing

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.

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Spinner not appearing

On what event do you invoke the service?

Andrés Méndez
Posts: 0
Joined: Thu Apr 18, 2013 6:13 pm

Spinner not appearing

On "Load".

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Spinner not appearing

Try with "page show"

Andrés Méndez
Posts: 0
Joined: Thu Apr 18, 2013 6:13 pm

Spinner not appearing

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 :-)

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Spinner not appearing

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

Andrés Méndez
Posts: 0
Joined: Thu Apr 18, 2013 6:13 pm

Spinner not appearing

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

Ahmad Al-Husseini
Posts: 0
Joined: Thu Jul 10, 2014 8:37 am

Spinner not appearing

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

Return to “Issues”