2 Replies Latest reply on May 23, 2008 7:23 AM by Jonck van der Kogel

    rich:subTable problem with validation errors

    Jonck van der Kogel Newbie

      Hi,
      I'm having some problems with rich:subTable. The problem is that when I submit my form and validation errors occur the value of a h:inputText in the subTable is cleared. So for example:

      <rich:dataTable
       value="#{backingBean.holders}"
       var="holder">
       <f:facet name="header">
       <rich:columnGroup>
       <rich:column>
       <h:outputText value="Test">
       </rich:column>
       </rich:columnGroup>
       </f:facet>
       <rich:column>
       <h:inputText value="#{holder.requiredTest}" required="true" />
       </rich:column>
       <rich:subTable
       value="#{holder}"
       var="holderSubTable">
       <rich:column colspan="1">
       <h:inputText value="#{holderSubTable.test}" />
       </rich:column>
       </rich:subTable>
      </rich:dataTable>
      


      If I leave the requiredTest field empty and fill the test field with a value and submit my form, I will get a validation error (which is correct of course) and the test field will be cleared.

      If I now rewrite this table to:

      <rich:dataTable
       value="#{backingBean.holders}"
       var="holder">
       <f:facet name="header">
       <rich:columnGroup>
       <rich:column>
       <h:outputText value="Test">
       </rich:column>
       <rich:column>
       <h:outputText value="Test2">
       </rich:column>
       </rich:columnGroup>
       </f:facet>
       <rich:column>
       <h:inputText value="#{holder.requiredTest}" required="true" />
       </rich:column>
       <rich:column>
       <h:inputText value="#{holder.test}" />
       </rich:column>
      </rich:dataTable>
      


      and submit my form under the same conditions, the test field retains it's value.

      Any ideas how I can let the test field retain it's value using a subTable?

      Thanks, Jonck