Sunday, June 8, 2014

Ajax implementation with ActionStatus in visualforce page?

 Ajax implementation with ActionStatus in visualforce page?



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="05"/>
</apex:form>
</apex:page>

Apex Class Controller:

public class exampleCon {
Integer count = 0;

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

public Integer getCount() {
return count;
}
}





if you want to decrease the time interval just set the interval="05" and test.

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>








1 comments:

Unknown said...

Thanks a lot for sharing the amazing post. Must read blog to get useful information.

Salesforce Implementation Services

Post a Comment

 
| ,