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
2 réponses