1 Reply Latest reply on Dec 30, 2008 11:09 AM by drtog16

    submittedValue lost in a:repeat when commandbutton immedate=

    drtog16


      When the page below is submitted the values in the a4j:repeat lost -- it doesn't render the submittedValues as the field at the top of the form does.

       <h:form id="savetest">
       <h:inputText id="first" value="#{requestScope.blah}"/>
       <a4j:repeat id="testList" value="#{objectManager.test}" var="test">
       <h:inputText id="xxx" value="#{test.name}"/>
       </a4j:repeat>
       <h:commandButton id="b" action="null" immediate="true"/>
       </h:form>
      


      If I was using tomahawk's t:dataTable I know I could do the following:
      <t:dataTable preserveRowStates="true" id="testListDataTable" value="#{objectManager.test}" var="test">
       <h:column>
       <h:inputText id="xxx" value="#{test.name}"/>
       </h:column>
       </t:dataTable>
      


      Note the preserveRowStates="true" on the t:dataTable above.

      I have tried componentState="#{objectManager.teststate}" on the a4j:repeat but that doesn't seem to do what I want.

      How do i get the components within a a4j:repeat, a4j:dataList, or a4j:dataTable to render with their submittedValue when a commandButton with immediate=true is clicked?

      I am using JSF 1.2 and RichFaces 3.2.2.SR1.

      Thanks,
      David

      PS. I have spent ALL DAY (litterally) on this so please some help if you have any ideas... THANKS!

        • 1. Re: submittedValue lost in a:repeat when commandbutton immed
          drtog16

          Well looking at the source code of richfaces it seems their iterating components subclass uidataadaptor. that class has the following method

           protected boolean keepSaved(FacesContext context) {
           // For an any validation errors, children components state should be preserved
           FacesMessage.Severity sev = context.getMaximumSeverity();
           return (sev != null && (FacesMessage.SEVERITY_ERROR.compareTo(sev) >= 0));
          


          Else where in the code the keepSave(..) method is called to test if it should remove the state of children.
          Possible solutions are to either add a faces message of at least severity error.. or modify the code.. hmmm...