博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ADF HOW TO: How to stop adf:Poll
阅读量:4921 次
发布时间:2019-06-11

本文共 1077 字,大约阅读时间需要 3 分钟。

Issue:

When you triger a adf:poll, you may want to stop it untill some conditions are meet. Following solution will show you how to achieve it.

 

Solution:

public void onPoll(PollEvent pollEvent) {        RichPoll poll = (RichPoll)pollEvent.getComponent();        System.out.println("...setting to -1");        poll.setInterval(-1);        AdfFacesContext.getCurrentInstance().addPartialTarget(poll);            }

Before you did above thing, please remember set clientComponent="true" inside <adf:poll>.

Following is explaination which is provided by Matthew Carrigy

This seems to be a better method that setRendered(false), as I noticed that even though the pollEvent isn't fired after setting the rendered attribute to false, it does still poll the server at the said interval, and any loss of connection will result in the popup message over and over until the window is closed. When using the second method this does not occur.

Setup a statusIndicator on the page and you will see it still polling.

Reference:

转载于:https://www.cnblogs.com/duadu/archive/2012/05/16/6335521.html

你可能感兴趣的文章
python 中的input()和raw_input()功能与使用区别
查看>>
如何正确配置客户端tnsname.ora文件
查看>>
当用户输入网址到页面展现,发生了什么?
查看>>
Linux运维:安装CentOS7图解
查看>>
CSS隐藏页面元素的方法
查看>>
B. Mike and Feet Codeforces Round #305 (Div. 1) (并查集)
查看>>
学习Python遇到的那些坑
查看>>
目录大纲
查看>>
PAT 甲级 1104 sum of Number Segments
查看>>
【BZOJ4827】【HNOI2017】礼物
查看>>
awk运用
查看>>
python socket 编程之三:长连接、短连接以及心跳
查看>>
BootStrap的入门和响应式的使用
查看>>
Spring boot Mybatis
查看>>
【zookeeper】ACL super 超级管理员
查看>>
On Pi
查看>>
定位--position属性
查看>>
学习Android过程中一些小知识点的积累
查看>>
关于lis的方案数
查看>>
线段树的高级操作
查看>>