7 Replies Latest reply on Nov 25, 2011 7:28 AM by milovdzee

    oncomplete not firing (RF4)

    milovdzee

      Hello,

       

      in the following example the oncomplete is not called. Why not? I tried it with RF4.1M4 and RF4.1RC1.

      - RF4.1RC1

      - Tomcat 7.0.21

      - MyFaces 2.1.4

       

      test.xhtml:

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

                           

      <document

          xmlns="http://www.w3.org/1999/xhtml"

          xmlns:h="http://java.sun.com/jsf/html"

          xmlns:a4j="http://richfaces.org/a4j"

      >

       

      <h:head>

      </h:head>

       

      <body>

          <h:form id="form">

              Knopje:

              <a4j:commandButton id="button"

                  value="button"

                  onbegin="console.log('begin');"

                  oncomplete="console.log('complete');"

                  actionListener="#{testBean.incCounter()}"

                  render="counter"

                  execute="@this"

              />

              <br/>

              Counter: <h:outputText id="counter" value="#{testBean.counter}"/>

          </h:form>

      </body>

      </document>

       

      With bean:

      package com.vetmanager.base.test;

       

      import javax.faces.bean.ManagedBean;

      import javax.faces.bean.SessionScoped;

       

      @ManagedBean

      @SessionScoped

      public class TestBean {

          private int counter = 0;

       

          public void incCounter() {

              counter++;

          }

       

          public int getCounter() {

              return counter;

          }

       

          public void setCounter(int counter) {

              this.counter = counter;

          }

       

      }

       

      web.xml:

      <?xml version="1.0" encoding="UTF-8"?>

      <web-app

          xmlns="http://java.sun.com/xml/ns/javaee"

          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"

          version="2.5"

      >

           <context-param>

              <param-name>javax.faces.FACELETS_REFRESH_PERIOD</param-name>

              <param-value>2</param-value>

          </context-param>

       

          <servlet>

              <servlet-name>Faces Servlet</servlet-name>

              <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

              <load-on-startup>1</load-on-startup>

          </servlet>

          <servlet-mapping>

              <servlet-name>Faces Servlet</servlet-name>

              <url-pattern>*.xhtml</url-pattern>

          </servlet-mapping>

      </web-app>

       

      faces-config:

      <?xml version="1.0"?>

      <faces-config

          xmlns="http://java.sun.com/xml/ns/javaee"

          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"

          version="2.0"

      >

      </faces-config>