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://forums.oracle.com/forums/thread.jspa?threadID=966984
本文介绍了一种在ADF应用中停用轮询组件的方法,通过设置轮询组件的interval属性为-1来实现,避免了即使将rendered属性设为false后仍会发生的服务器轮询行为。
7064

被折叠的 条评论
为什么被折叠?



