Stopping ajax polling in jsf primefaces?

11,047

this code works like a charm in my case:

 <p:poll  interval="2" update="flightsTable" widgetVar="poll"  
         autoStart="false" listener="#{searchFlightBean.checkIfSearchCompleate}"/>

Method in searchFlightBean:

public void checkIfSearchCompleate() {
    if(searchCompleate) {
        RequestContext reqCtx = RequestContext.getCurrentInstance();
        reqCtx.execute("poll.stop();");
    }
}
Share:
11,047
wild
Author by

wild

Updated on June 14, 2022

Comments

  • wild
    wild almost 2 years

    i am using prime-faces 3.2. Ajax polling is not get stopped, i am using stop attribute to stop the polling and i am trying to stop it form the bean using getter and setters for stop. Even i have used java script to stop but i can't. Any solution to stop polling?

  • wild
    wild over 11 years
    poll call will get stopped. but in firebug i can able to see the call running.it get stopped only after page refresh
  • Janier
    Janier about 5 years
    did you ever get a solution to this?