p:poll stop tag not working?

UI Components for JSF
Post Reply
Dsleeper
Posts: 119
Joined: 29 Jul 2010, 13:33
Location: Bergen, Norway
Contact:

01 Sep 2011, 09:22

According to http://code.google.com/p/primefaces/iss ... il?id=2057 this is implemented.

However in my testcase the poll still triggers even though mybean.stopPoll evaluates to true:

Code: Select all

<p:poll stop="#{mybean.stopPoll}" listener="#{mybean.onPoll}"/>
Is this still an issue or have I misunderstood something?
Primefaces, Mojarra, Tomcat

http://www.dsleeper.net
https://www.mylog.no

Lucu
Posts: 10
Joined: 16 Nov 2011, 16:13

16 Nov 2011, 16:16

Hello,

I agree. The poll-stop attribute is not working. I added a note to the issue you linked too above. Dont' hesitate to star it.

Another glitch concerning this is the sentence in the M4 User Manual:

"Or bind a boolean variable to the stop attribute and set it to false at any arbitrary time." --> should be "true".

Best,
Lucu

Lucu
Posts: 10
Joined: 16 Nov 2011, 16:13

17 Nov 2011, 11:51

Btw, an easy workaround (still it's a WA and a not a bug fix) would be to do something like this:

<p:outputPanel rendered="#{bean.stop}">
<script type="text/javascript">poll.stop();</script>
</p:outputPanel>

and refreshing this (or the parent component) by the ajax poller.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

14 Dec 2011, 15:49

This works for me;

Code: Select all

package org.primefaces.examples.view;

import java.io.Serializable;

public class CounterBean implements Serializable{

	private int count;

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}
	
	public void increment() {
		count++;
        
        if(count == 3) {
            stop = true;
        }
}
    
    private boolean stop = false;

    public boolean isStop() {
        return stop;
    }

    public void setStop(boolean stop) {
        this.stop = stop;
    }
}

Code: Select all

<h:form>
                <h:outputText id="txt_count" value="#{counterBean.count}" />

                <p:poll interval="3" listener="#{counterBean.increment}" update="txt_count" stop="#{counterBean.stop}"/>
            </h:form>

Lucu
Posts: 10
Joined: 16 Nov 2011, 16:13

21 Dec 2011, 11:12

Hi,

I'm using the RC2 and still have the same issue. I didn't test your example, but what happens if you add [autoStart="true" async="true"], without updating the poll component itself during the poll?

@all
What experienced the other users, probably having more complex cases?

Hint:
My <p:poll autoStart="true" update="xxx"> references well a componement external to the <poll> component (i.e. <poll> is not updating itself). I don't have the classic message "INFO: Cannot find component with identifier "xxx" in view.", which indicates that the specified ID cannot be located (by PF) - so this seems OK. However, doing <p:poll rendered="#{stopcondition}"> works fine stopping the polling. It looks like the update attribute isn't only targeting the addressed component, but the <poll> component gets updated as well. If this is by design, then the "autoStart" should not start the poll when the stop condition is fullfilled.

Best wishes,
Lucu

Danijel
Posts: 151
Joined: 02 Apr 2012, 01:04

13 Jul 2012, 18:13

I am also having problems with stoping the polling.

Is this a verified bug? Is it fixed in the meantime?
| Tomcat 7.0.25 + MyFaces 2.1.6 + PrimeFaces 3.5.0 | Firefox 21 |

Danijel
Posts: 151
Joined: 02 Apr 2012, 01:04

13 Jul 2012, 18:46

optimus.prime wrote:This works for me...
Hi optimus,

How do you start the poll again after it stops?
| Tomcat 7.0.25 + MyFaces 2.1.6 + PrimeFaces 3.5.0 | Firefox 21 |

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 59 guests