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: ' ')}" />
<g:actionSubmit class="eliminar" action="delete" value="${message(code: 'default.button.eliminar.label', default: ' ')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure you want to delete?')}');" />
</td>
</tr>
</g:form>
ataylor
2010-10-11 19:40:28