2 Replies Latest reply on Mar 10, 2008 4:59 AM by baz

    dataTable loosing entries

    baz

      Hello,
      i am quite sure that there is a JIRA entry about this subject. If have tried to find it in Seam and in Richfaces project but with no luck :-(. Perhaps someone can help me.
      Here comes the problem:
      Outline of my webpage:

       <ui:define name="body">
       <h:form >
       <rich:panel>
       <f:facet name="header">
       <h:outputText value="" />
       </f:facet>
      
       <rich:dataTable id="germinationList" var="germination"
       value="#{germinationsForGerminationTest}"
       rendered="#{not empty germinationsForGerminationTest}">
       <rich:column>
       <f:facet name="header">Samples</f:facet>
       <a4j:commandButton
       action="#{bean.startEdit(germination.id,germination,0)}"
       reRender="modalForm, conversations"
       value="Results">
       <rich:componentControl for="enterResults" operation="show" event="oncomplete"/>
       </a4j:commandButton>
       </rich:column>
       </rich:dataTable>
       </rich:panel>
       </h:form>
      
       <rich:modalPanel id="enterResults" >
       <f:facet name="header">
      [...]
       </f:facet>
       <h:form id="modalForm">
       <h:panelGrid columns="2" border="1" cellspacing="5">
      [...]
       </h:panelGrid>
      
       <rich:panel id="germinationPanel">
       <f:facet name="header">Enter results</f:facet>
       <rich:messages globalOnly="false"/>
       <rich:dataTable value="#{bean.sampleList}" var="sample">
       <f:facet name="header">
      [...]
       </f:facet>
      
       <rich:column>
       [...]
       </rich:column>
      [...]
       </rich:dataTable>
       </rich:panel>
       <h:commandButton action="#{bean.save}" value="save"></h:commandButton>
       </h:form>
       </rich:modalPanel>
       </ui:define>
      </ui:composition>
      

      bean.startEdit is called and than the modal panel is shown.
      <Bean.startEdit creates a list of sample Objects. This list is shown in the modalpanel. The user is able to modify the sampleObjects in the modalpanel and then save them back. This works fine. But our first try was to use a seam DataModel or to outject the List. So that we can use
      <rich:dataTable value="#{sampleList}" var="sample">
      instead of
      <rich:dataTable value="#{sampleList}" var="sample">

      But this does not work. The List is correctly created and displayed. But when the save-button is clicked, some entries of the list are lost.Sometimes all, sometimes only one. This only happens when a context variable is used for the dataTable List value. (@DataModel or @Out on the List in the Bean)

      FYI: I have not tried to use a h:dataTable.

      What i can remember that there is a jira issue stating that a table looses Data, even in the demos on the rich faces demo pages. It would be nice if someone could give me a pointer to the issue. Thanks
      Ciao,
      Carsten