在jsf primefaces中停止Ajax轮询吗? [英] Stopping ajax polling in jsf primefaces?

查看:57
本文介绍了在jsf primefaces中停止Ajax轮询吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用素面3.2.Ajax轮询不会停止,我正在使用stop属性来停止轮询,并且我正在尝试使用getter和setters来停止它从bean的形成.即使我已经使用Java脚本停止了,但我不能停止.有什么方法可以停止轮询?

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?

推荐答案

在我的案例中,这段代码就像一个咒语:

this code works like a charm in my case:

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

searchFlightBean中的方法:

Method in searchFlightBean:

public void checkIfSearchCompleate() {
    if(searchCompleate) {
        RequestContext reqCtx = RequestContext.getCurrentInstance();
        reqCtx.execute("poll.stop();");
    }
}

这篇关于在jsf primefaces中停止Ajax轮询吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆