this is the gsp code:
td align="left" class="pinkbox" style="height: 35px" width="43%">
${fieldValue(bean: bookInstance, field: "description")}<br />
input type="text" id="description" name="description" value="${fieldValue(bean: bookInstance, field: "description")}" size="30px" />
g:link controller="conference" action="edit" id="${bookInstance.id}">Update </g:link></td>
groovy code in the controller:
def edit ={
println params.description
def bookInstance = Book.get(params.id)
try{
bookInstance.description = params.description
bookInstance.save()
redirect(action:'show',id:bookInstance.id)
}catch(Exception e){
flow.message ="an error occurred during update"
redirect(action:'show',id:bookInstance.id)
}
}
it returns a null value while i insert a value inside the textbox control. i try omit value attribute from input type text but without any effect
input type=”hidden” name=”Id”value=”${bookInstance.id}”>
td align=”left” class=”pinkbox” style=”height: 35px” width=”43%”>
${fieldValue(bean: bookInstance, field: “description”)}
g:textField type=”text” name=”description” value=”${fieldValue(bean: bookInstance, field: “description”)}” size=”30px” />
g:actionSubmit action=’edit’ value=”Update” >