5 Replies Latest reply on Mar 31, 2009 7:33 AM by Ioana Iacob

    Datatable delete last row problem

    Ioana Iacob Newbie

      Hello, I seem to have a problem with the datatable. It does not delete the last row. Well actually it does, because if I navigate to another page, and come back, the table is gone.

      <rich:dataTable id="servicesTable" value="#{GestioneServiziBean.serviceList}" var="service" reRender="ds"
       rows="7" width="100%" rowKeyVar="row">
       <!-- headers -->
       <f:facet name="header">
       <rich:columnGroup>
       <rich:column >
       <h:outputText value="#{pageMessages.labelDescrizione}" styleClass="headerText" />
       </rich:column>
       <rich:column >
       <h:outputText value="#{pageMessages.labelDipendenza}" styleClass="headerText" />
       </rich:column>
       <rich:column>
       </rich:column>
       <rich:column>
       </rich:column>
       </rich:columnGroup>
       </f:facet>
      
       <!-- descrizione -->
       <rich:column filterBy="#{service.descr}" filterEvent="onkeyup">
       <rich:inplaceInput value="#{service.descr}" layout="block" viewClass="inplace" />
       </rich:column>
      
       <!-- dipendenza -->
       <rich:column styleClass="calign" filterBy="#{service.parent.descr}" filterEvent="onkeyup">
       <rich:inplaceSelect value="#{service.parent.id}"
       layout="block" viewClass="inplace" openOnEdit="true">
       <f:selectItems value="#{GestioneServiziBean.listaDipendenze}" />
       </rich:inplaceSelect>
       </rich:column>
      
       <!-- salva -->
       <rich:column styleClass="calign" width="30">
       <f:facet name="header"></f:facet>
       <a4j:commandLink action="#{GestioneServiziBean.saveService}" reRender="servicesTable">
       <h:graphicImage styleClass="icon" url="/images/conferma.png" />
       <f:setPropertyActionListener value="#{row}" target="#{GestioneServiziBean.selIndex}"/>
       </a4j:commandLink>
       </rich:column>
      
       <!-- elimina -->
       <rich:column styleClass="calign" width="30">
       <f:facet name="header"></f:facet>
       <a4j:commandLink action="#{GestioneServiziBean.deleteService}" reRender="servicesTable">
       <h:graphicImage styleClass="icon" url="/images/delete.png" />
       <f:setPropertyActionListener value="#{row}" target="#{GestioneServiziBean.selIndex}"/>
       </a4j:commandLink>
       </rich:column>
      
       <!-- pagination -->
       <f:facet name="footer">
       <rich:datascroller id="ds" renderIfSinglePage="false" />
       </f:facet>
       </rich:dataTable>