I implement some dialogs that need a general poll in order to get the latest values from the server. I am trying to use p: poll, but unfortunately I cannot stop it. I start a poll when a user clicks a button in one dialog box and stops when a user clicks a button in a child dialog. This is the code I use to start and stop polling:
firstDialog:
<p:poll autoStart="false" widgetVar="pollQtdDisponivelCarregamento" immediate="true"
update="labelQuantidadeDisponivelCarregamento labelQuantidadeDisponivelItem"
listener="#{atualizadorQuantidadeDisponivelProduto.atualizarQuantidadeDisponivel(modeloPopupCarregarProduto.produtoSelecionado)}" />
<p:commandButton action="#{controladorPopupCarregarProduto.abrir}"
value="#{vendaMsg['popup.pre_venda.botao.adicionar_produto']}"
title="#{vendaMsg['popup.pre_venda.botao.adicionar_produto.descricao']}"
update="@form" onclick="pollQtdDisponivelCarregamento.start()" />
childDialog:
<p:commandButton value="OK" style="float:right" immediate="true"
action="#{controladorPopup.fechar}" update="@form"
onsuccess="pollQtdDisponivelCarregamento.stop();" />
one thing I can’t understand: when I break javascript execution using Firebug debugging, polling stops correctly, but when I do not, it just doesn't stop. Does anyone know how I can solve this problem?