0 Replies Latest reply on May 28, 2008 2:16 PM by Ziphyre Marco

    Random behavior when deleting rows from datatable

    Ziphyre Marco Newbie

      Hi,

      I have a datatable with "delete" links on every row. The table is reRendered every time a row is deleted. But although the delete link functions on the database side, the deleted rows get rendered with subsequent deletes (and reRenders). But not always, generally the problem is on the first or on the last row...

      A reload of the page with refresh button puts the datatable to its normal state (deleted rows gone). I also tried with a4j:htmlCommandLink, but that doesn't do the job, which is an other thing I don't get. Since a refresh do the trick, why not a4j:htmlCommandLink?

      Anyway, here is the code:

      <a4j:form id="hotspotForm">
       <h1 id="lOne" class="accordion_toggle first mail">Mil Box</h1>
       <a4j:outputPanel layout="block" id="mailList" styleClass="accordion_content mail">
      
       <rich:dataTable id="messages" var="msg" value="#{messageList}" rows="4">
       <rich:column>
       <img src="#{msg.from.imagePath}" alt="" />
       <h4>#{msg.from.firstName} #{msg.from.lastName}</h4>
       <a4j:commandLink action="#{quickMessages.select}"
       value="#{empty msg.subject}" />
       <div id="message_#{msg.id}_body" style="display:none;">
       <div id="message_#{msg.id}_text">
       #{msg.text}
      
       <a4j:commandLink action="#{quickMessages.deleteMessage}"
       reRender="messages" value="Delete" />
       </div>
       <div id="message_#{msg.id}_replyArea" style="display:none">
       <a4j:region>
       <h:inputTextarea value="#{quickMessages.quickText}" cols="13" rows="10" />
       <a4j:commandLink action="#{quickMessages.sendReply}" value="Send" />
       </a4j:region>
       </div>
       </div>
       </rich:column>
       </rich:dataTable>
       </a4j:outputPanel>
      </a4j:form>