0

I'm using poll component of primefaces 5.1

I've jsf2 page like

 <html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:p="http://primefaces.org/ui"
        xmlns:pe="http://primefaces.org/ui/extensions">
      <ui:composition template="/templates/securedContent.xhtml">
      <ui:define name="content">


       <h:form id="form">
                <p:poll interval="1"
                    listener="#{counterView.increment}" update=":form" />
                <p:outputLabel value="#{counterView.number}" />
        </h:form>

      </ui:define>
      </ui:composition> 

     </html>

and the bean is :

package main.com.zc.project.presentation.attendance.bean;


import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.event.ActionEvent;

@ManagedBean
@ViewScoped
public class CounterView implements Serializable {

   private int number;

   public int getNumber() {
       return number;
   }

   public void increment() {
       number++;
   }
}

I'm using primefaces 5.1 , and the poll doesn't call Bean method as expected could anyone help me please?

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
Omnya.Alaa
  • 21
  • 1
  • 8
  • _"and the poll doesn't call Bean method as expected"_ How do you know... What did you investigate? – Kukeltje Feb 21 '16 at 12:19
  • I made debug on bean method , and no performing occures but on client side as I made instead of listener >>> oncomplete= alert('hi') and the alert appears but method no – Omnya.Alaa Feb 21 '16 at 13:14
  • that is just a small part of debugging. Check the requests in the browser, etc.. – Kukeltje Feb 21 '16 at 13:55
  • 200 OK POST http://localhost:8080/SurveyMaker/system/performedSurveys/survey.xhtml <![CDATA[0]]> <![CDATA[H4sIAAAAAAAAAM1XX2wURRifXnuUttgUKv9MS0opRE3d4+7656AgFFrk4lEIV6tAlM7tDndD9x8zs9ctCAkmaiIxmKgxJhhN9MEH8AVfeNEoMSYkEuWFRGKixsT4QEKMiTE +6Mzs7d71buGOJ9iHvbmdb+b7fb/vz3xz8TaI2pSA5cdhESoOw7qyF9LCPmhHW3/86uqq2R+aQWQPaNctqO2BKrNIGrSxAkG0YOmaa /5YJyJj4QAAA=]]> – Omnya.Alaa Feb 21 '16 at 13:59
  • Well, something IS being called... Please create an [mcve] I see things in the update that are not in your code... – Kukeltje Feb 22 '16 at 11:21
  • Possible duplicate of [commandButton/commandLink/ajax action/listener method not invoked or input value not set/updated](https://stackoverflow.com/questions/2118656/commandbutton-commandlink-ajax-action-listener-method-not-invoked-or-input-value) – Kukeltje Oct 29 '17 at 07:34

0 Answers0