Activity Forums Salesforce® Discussions How can I stop actionpoller action after two consecutive runs?

  • Abhinav

    Member
    June 2, 2016 at 12:36 PM

    Hi Himanshu,

    Please use the below snippet.

    <apex:page controller="componentPoller">
    <apex:form >
    <apex:actionPoller action="{!increment}" rerender="count" interval="5" enabled="{!IF(count = 2,false,true)}"/>

    <apex:outputPanel id="count">
    {!IF(count = 2,false,true)}
    {!count}
    </apex:outputPanel>
    </apex:form>
    </apex:page>

    Controller :-

    public class componentPoller{

    public Decimal count {get; set;}

    public componentPoller(){
    count = 0;
    }

    public void increment(){
    count++;
    }
    }

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos

Salesforce Admin Certification 2020 Questions Explained with References - Part II

Video in

How to prepare and pass Salesforce Admin Certification with Practice Exam Questions 2020 practice questions and answers for the Salesforce Administration Salesforce Certified Admin Exam Questions Salesforce Administrator Certification Exam…