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

    a4j:repeat sibmit form problem

    Eugene Kisly Newbie

      Hi.
      Here is test example:
      Page:

      <%@ 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" %>
      
      
      <html>
      <head>
       <title>CBC</title>
       <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>
      </head>
      
      <body>
      <f:view locale="#{commonBean.locale}">
      
       <a4j:outputPanel>
       <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>
      
      
       <a4j:form id="form2">
       <h:inputText id="in" value="#{testBean.number}"/>
       <a4j:commandButton reRender="form2:in" action="#{testBean.action}"/>
       </a4j:form>
      
      
       <a4j:form id="form3">
       <h:inputText id="in" value="#{testBean.number}"/>
       <a4j:commandButton reRender="form3:in" action="#{testBean.action}"/>
       </a4j:form>
      
       <h:outputText value="repeat end"/>
       <br/>
       <br/>
       <br/>
       <br/>
       <br/>
       </a4j:repeat>
       </a4j:outputPanel>
      
      </f:view>
      </body>
      </html>
      


      Bean:
      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);
       }
      }


      Spring:
      <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 1.2.0.9
      Spring 1.5.6
      Jboss 4.2.3