Ajax implementation in visualforce page using ActionStatus

Visualforce Page:

<apex:page controller=”exampleCon”>
<apex:form >
<apex:outputText value=”Watch this counter: {!count}” id=”counter”/>
<apex:actionStatus startText=” (incrementing…)” stopText=” (done)” id=”counterStatus” />
<apex:actionPoller action=”{!incrementCounter}” rerender=”counter” status=”counterStatus” interval=”60″/>
</apex:form>
</apex:page>

Apex Class Controller:

public class exampleCon {
Integer count = 0;

public PageReference incrementCounter() {
count++;
return null;
}

public Integer getCount() {
return count;
}
}

Please use the below snippets code to show the status  by image.

<apex:actionStatus id=”counterStatus” >
<apex:facet name=”start” >
<apex:image url=”{!$Resource.LoadingImage}” />
</apex:facet>
</apex:actionStatus>

 

Written by 

I am Sakthivel Madesh, a certified Salesforce Advanced Developer & Administrator working on Salesforce Technology since 2011. I am currently working in Techforce Services as Sr. Salesforce Developer. I have worked on multiple technologies Like PHP, Java, Salesforce, I am very passionate about Salesforce and to earn 15x Salesforce Certification. I love Trailhead for learning Salesforce Skill and Become a Trailhead 5x Ranger too. I Love to Learn & Share my Salesforce knowledge to Salesforce Learners/Beginner using My Blog and Salesforce Community.

Leave a Reply

Your email address will not be published. Required fields are marked *

*