1 Reply Latest reply on Oct 24, 2008 10:16 AM by Tomasz Wilczynski

    Two datatables in a form survive postback badly

    Tomasz Wilczynski Newbie

      Hi guys, can anyone help me with this problem? I have a following form:



      <h:form>
        <h:commandButton action="#{conversationBean.submit}" value="test"/>
      
        <h:dataTable  value="#{conversationBean.list1}" var="entry1" id="dt1" >
          <h:column>
            <h:inputText value="#{entry1.value}" id="entryId1" />
          </h:column>
        </h:dataTable>
      
        <h:dataTable  value="#{conversationBean.list2}" var="entry2" id="dt2" >
          <h:column>
            <h:inputText value="#{entry2.value}" id="entryId2" />
          </h:column>
        </h:dataTable>
      </h:form>



      Each table uses a list of entities and renders one input per entity (which is a Double). When I enter a non-number and submit, I retrun to the same page but the other datatable loses changes (it restores the original values) It takes at least one invalid value per datatable to keep changes of this datatable after postback and lose changes in the other dataTable. If both dataTables contain invalid values, all fields keep the changes after postback.


      The scenario happens inside a long-running conversation with SMPC. Using s:validate or f:convertNumber changes nothing. Switching to rich:dataTable makes it even more weird - it's not deterministic (random fields get restored). I suppose my page should get to update model values phase and then switch to render response after conversion errors. What am I missing?