I have to stop and start a p:poll in JSF using some conditions... I am able to do that by putting the poll in a panelgrid and making the panelGrid rendered... I thought its working since the pollOperationStatus is not called after I made the panelGrid rendered false... When I show it , it restarts as well..
But there is a network call still firing ; which messes up many things ;How to deal it?
<h:form>
My main form
</h:form>
<h:form id="mypollform">
<p:outputLabel id="currentTime" value="#{myBean.counter}" />
<h:outputText value="#{myBean.startPoll}" id="counter11" />
<p:panelGrid rendered="#{myBean.startPoll}">
<p:poll interval="8" widgetVar="poller" autoStart="true"
listener="#{myBean.pollOperationStatus}"
update=":#{p:component('newServerID')},:#{p:component('mypollform')}" />
</p:panelGrid>
</h:form>
Primefaces 7 Documentation says:
In your case this would be in
javaScript:PF('poller').stop();orPF('poller').start();Or bind a
booleanbean property the thestopattribute of thep:poll:Also beware that component IDs inupdateattribute are separated by space, not comma.