+2  A: 

The g:form you have is only on the final table column, with one hidden form parameter, the id. Delete works, since all it needs is an id. The update requires the rest of the form entries. The editable fields each have a form entry, but they are not enclosed in that g:form, so their data isn't submitted with the form.

You need to make the g:form enclose all the columns of the table row. For example:

<g:form>
  <tr>
    <td>${densityInstance?.id}<g:hiddenField name="id" value="${densityInstance?.id}" /></td>
    <td><g:textField name="commodity" value="${...}"/></td>
    ...
    <td>
      <g:actionSubmit class="editar" action="update" value="${message(code: 'default.button.editar.label', default: '&nbsp;&nbsp;&nbsp;')}" />
      <g:actionSubmit class="eliminar" action="delete" value="${message(code: 'default.button.eliminar.label', default: '&nbsp;&nbsp;&nbsp;')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure you want to delete?')}');" />
    </td>
  </tr>
</g:form>
ataylor
Nope, it is not working right. I'm pretty sure the error is in the controller in the def update {}
fgualda87
I do get a message saying Density 1 updated
fgualda87
Try printlning params (or look at it in a debugger) at the beginning of `update`. Does it contain the updated values?
ataylor
Ok. I made an if statement: `if(params?.Rcommodity){ println "${params.Rcommodity}" }` and it prints the value that I put in the textfield. I think I am missing how to link the new value to the field :/
fgualda87
But Rcommodity is only the name of the first Row,
fgualda87
The form tag names should match the property names in your domain object for the `densityInstance.properties = params` assignment to work.
ataylor