I try to make a site where I place a clock. Not a default primefaces clock because I need the actual time not just to show it. I use Netbeans8.0, Java8.0, Primefaces5.0, and I'm building a Mobile site.
So I tried the p:poll but it not works for me.
@ViewScoped
@ManagedBean(name = "navigationTo")
public class NavigationTo implements Serializable{
private int number;
public int getNumber() {
return number;
}
public void increment() {
number++;
}
}
<h:body>
<pm:page id="index">
<pm:header title="xyz"></pm:header>
<pm:content>
<h:form>
<p:growl id="growl" showDetail="true"/>
<h:outputText id="txt_count" value="#{navigationTo.number}" />
<p:poll interval="3" listener="#{navigationTo.increment}" update="txt_count" />
<p:graphicImage value="xyz.png" style="width: 30%;
I use this default primefaces example but only shows the 0 and it's not incrementing...
Anyone any idea?
!!!EDIT: Primefaces Mobile (here: pm) not support polling. So it only work with the basic primefaces.