p:poll variable interval

UI Components for JSF
Post Reply
orko2002
Posts: 44
Joined: 27 Dec 2010, 22:31

13 May 2011, 18:46

Hi i try to make a poll with a variable interval but the value is no re rendered, i put 10 at start and take 10 when i update

this is the code for that update the refresh time for poll

Code: Select all

<h:form prependId="false">
<h:panelGrid  columns="2" cellpadding="10">
	<h:panelGroup>
		<h:outputLabel for="refresh" value="#{msg.label_refresh} " />
		<p:spinner id="refresh" value="#{tableroManager.refreshTime}" 
				min="0" max="999" style="width=30px;" >
			<p:ajax update="poll" process="@this" />
		</p:spinner> 
		<h:outputLabel value=" #{msg.label_segundos}" />
	</h:panelGroup>
	<p:commandButton id="btnPoll" value="#{msg.label_stop}" 
		actionListener="#{tableroManager.actualizarPoll}" 
		oncomplete="handlePollStart(xhr, status, args);" widgetVar="btnPoll" process="@this" />
</h:panelGrid>
</h:form>  
this is de poll code

Code: Select all

<h:form prependId="false">
	<p:poll id="poll" interval="#{tableroManager.refreshTime}" actionListener="#{tableroManager.refreshData}"  
			update="terminales" process="@this" autoStart="true" onerror="poll.stop();" widgetVar="poll"/>
								
	<p:dataGrid var="terminal" value="#{tableroManager.terminales}" columns="13" 
			paginator="false" effect="true" id="terminales" >
......
......

callahan
Posts: 768
Joined: 27 May 2010, 22:52

13 May 2011, 21:25

The poll component renders itself as a line of JavaScript. It doesn't actually render any HTML. This means that there is no DOM element with the id "poll" that can be updated. Perhaps it would work if the poll was placed inside another component such as an outputPanel and then the outputPanel could be updated instead.

publicdinamicpi
Posts: 7
Joined: 09 Sep 2011, 15:55

14 Aug 2018, 21:26


Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 25 guests