You need to sign in to do that
Don't have an account?
surya prasad G A
when we click on visualforce page tab in lightning app how to display the loading spinner
When we click on visualforce page tab in lightning app how to display the loading spinner
https://salesforce.stackexchange.com/questions/65580/popup-spinner-style-apexactionstatus
You can keep the spin function in constructor and remove the command button.
Acutally the spin function in apex class is a method for which the user is waiting in the screen to execute.
What you need to do is to call whatever function you are executing in your case. In case you are navigating from one tab to another. There could be some sections in new tab which needs data to be populated. So, the function populating that data should be called from the page and the page will show this spinner till function executes and returns something.
Hope this helps.