5 Replies Latest reply on Sep 5, 2007 4:22 AM by haoues01

    How to edit row DataTable

    haoues01

      Hello,

      I want to edit a row directly in a dataTable, but the code below never calls my action method when I submit. If I select another page using datascroller then the method is called. Any help would be welcome !

      <rich:datascroller for="list_grd_dt" maxPages="100"
      renderIfSinglePage="false" />
      <rich:dataTable id="list_grd_dt" value="#{compMgt.grdEdit.grdList}" var="grdWpr" rows="3"
      width="100%" first="#{compMgt.grdEdit.rowToEdit}"
      onRowMouseOver="this.style.backgroundColor='#F1E7C3'"
      onRowMouseOut="this.style.backgroundColor='#{a4jSkin.tableBackgroundColor}'">
      <a4j:support event="onRowDblClick"
      action="#{compMgt.grdEdit.edit}" actionListener="#{compMgt.grdEdit.load}"
      reRender="list_grd_dt">
      <a4j:actionparam name="grade_id" value="#{grdWpr.val.id}" />
      </a4j:support>
      <f:facet name="header">
      <rich:columnGroup>
      <rich:column >
      <h:outputText value="Name" />
      </rich:column>
      </rich:columnGroup>
      </f:facet>
      <rich:column>
      <h:outputText value="#{grdWpr.val.name}"
      rendered="#{!grdWpr.edit}" />
      <h:inputText value="#{grdWpr.val.name}"
      rendered="#{grdWpr.edit}" />
      </rich:column>
      ...
      <f:facet name="footer">
      <rich:columnGroup>
      <rich:column >
      <h:panelGrid columns="4" cellpadding="5" >
      <a4j:commandButton value="New" rendered="#{compMgt.grdEdit.btNew}"
      action="#{compMgt.grdEdit.create}"
      immediate="true"
      reRender="list_grd_op" />
      <a4j:commandButton value="Modify" rendered="#{compMgt.grdEdit.btModify}"
      action="#{compMgt.grdEdit.modify}"
      reRender="list_grd_op" />
      <a4j:commandButton value="Cancel" rendered="#{compMgt.grdEdit.btCancel}"
      action="#{compMgt.grdEdit.cancel}"
      reRender="list_grd_op" />
      <a4j:commandButton value="Confirm" rendered="#{compMgt.grdEdit.btConfirm}"
      action="#{compMgt.grdEdit.confirm}"
      reRender="list_grd_op" />
      </h:panelGrid>
      </rich:column>
      </rich:columnGroup>
      </f:facet>
      </rich:dataTable>
      Thanks.