Poll with PrimeFaces 5 Mobile

UI Components for JSF
Post Reply
estebanj1980
Posts: 1
Joined: 24 May 2014, 19:12

29 May 2014, 01:08

Hi everybody! I'm trying to test p:poll on PrimeFaces Mobile 5 but i couldn't get it to work. I'm using the code from the showcase.
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>
And this is the backing bean code:

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++;
    }

}
So far the counter on the Android 4.4 browser stays at 0.
Am i missing something here?
I'm really new to PrimeFaces an PrimeFaces Mobile, help would be greatly appreciated.

Thanks in advance!

FkJ
Posts: 183
Joined: 08 Jan 2010, 19:16

30 Jul 2015, 16:05

In case someone google here, this topic has a solution:

http://forum.primefaces.org/viewtopic.php?f=8&t=39895

kukeltje
Expert Member
Posts: 9605
Joined: 17 Jun 2010, 13:34
Location: Netherlands

04 Sep 2015, 10:29

The solution in the other page is only needed if you don't have any other PF tags on the page...

primate
Posts: 8
Joined: 12 Aug 2015, 10:54

16 Sep 2015, 10:00

Gran punto de vista!!!

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 25 guests