2 Replies Latest reply on Mar 3, 2009 9:29 AM by Nick Belaevski

    a4j:repeat sibmit form problem

    Eugene Kisly Newbie

      Here is test example:

      <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
      <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
      <%@ taglib uri="http://richfaces.org/a4j" prefix="a4j" %>
      <%@ taglib uri="http://richfaces.org/rich" prefix="rich" %>
       <link rel="icon" type="image/x-icon" href="/theme/images/favicon.ico">
       <link rel="stylesheet" type="text/css" href="theme/main.css"/>
       <script type="text/javascript" language="JavaScript" src="scripts/common.js"></script>
      <f:view locale="#{commonBean.locale}">
       <a4j:repeat id="juridicalRepeat" value="#{repeater.count}">
      <!-- repeater.count = 3-->
       <h:outputText value="repeat begin"/>
       <a4j:form id="form1">
       <h:inputText id="in" value="#{testBean.number}"/>
       <a4j:commandButton reRender="form1:in" action="#{testBean.action}"/>
       <a4j:form id="form2">
       <h:inputText id="in" value="#{testBean.number}"/>
       <a4j:commandButton reRender="form2:in" action="#{testBean.action}"/>
       <a4j:form id="form3">
       <h:inputText id="in" value="#{testBean.number}"/>
       <a4j:commandButton reRender="form3:in" action="#{testBean.action}"/>
       <h:outputText value="repeat end"/>

      public class TestBean {
       private int number;
       public int getNumber() {
       return number;
       public void setNumber(int number) {
       this.number = number;
       public void action(){
       System.out.println("ACCCCCCC!!!: " + number);

      <bean id="testBean" scope="request" class="com.cs.cbc.web.action.TestBean"/>

      Problem is that only last repeat block submit form and action execute normally.
      Blocks except the last submit 0 values.

      richfaces 3.2.0
      JSF Sun iml
      Spring 1.5.6
      Jboss 4.2.3