This is my test page code:
Code: Select all
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:pm="http://primefaces.org/mobile"
contentType="text/html"
xmlns:p="http://primefaces.org/ui">
<f:view renderKitId="PRIMEFACES_MOBILE" />
<f:view contentType="text/html" encoding="UTF-8"/>
<h:head>
</h:head>
<h:body >
<pm:page>
<pm:header >
Poll!
</pm:header >
<pm:content>
<h:form>
<h:outputText id="txt_count" value="#{counterView.number}" />
<p:poll interval="1" listener="#{counterView.increment}" update="txt_count" />
</h:form>
</pm:content>
<pm:footer>
</pm:footer>
</pm:page>
</h:body>
</html>
Code: Select all
import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
/**
*
* @author esteban
*/
@ManagedBean(name = "counterView")
@ViewScoped
public class CounterView implements Serializable{
private int number;
public int getNumber() {
return number;
}
public void increment() {
number++;
}
}
Am i missing something here?
I'm really new to PrimeFaces an PrimeFaces Mobile, help would be greatly appreciated.
Thanks in advance!