Skip to main content
I have created 'List Button' from Setup -> Contact object.

On that button click i have call one new created visualforce page.

When i click on button i want to show spinner on new visualforce page untill my backend apex class loads the data.

I have called my apex class using extension and action in <apex:page> tag.
2 answers
  1. Nov 4, 2025, 9:57 AM

    Hello @Salesforce Newbee E-ZPass Illinois

    To show a spinner until your Apex class loads data, use <apex:actionStatus> with <apex:page>'s action attribute. Wrap your content in <apex:outputPanel> and bind it to the action status. Example:

    <apex:actionStatus id="loadStatus">

    <facet name="start">

    <img src="/img/loading.gif" alt="Loading..." />

    </facet>

    </apex:actionStatus>

    <apex:outputPanel id="content" layout="block" rendered="{!NOT(ISNULL(data))}" >

    <!-- Your page content here -->

    </apex:outputPanel>

    Then link it to your action:

    <apex:page controller="YourController" action="{!loadData}" >

    <apex:form>

    <apex:actionFunction name="loadData" action="{!loadData}" status="loadStatus" />

    </apex:form>

    </apex:page>

    This will show the spinner until loadData completes. 

     

    Best Regards, 

    Delia Guzman 

     

0/9000