How to carry forward the parameters when g:actionSubmit
button is clicked?
Here is my gsp
code:
<g:checkBox name="msgCheck" checked="" value="${userInstance.emailId}"></g:checkBox>
...
<g:actionSubmit class="update" action="delete" value="Delete" params="${params}"></g:actionSubmit>
Here is my controller code:
def delete() {
try {
def user_list = params.msgCheck
//deleting the user
//successful.
redirect(action: "list", params: params)
} catch (Exception e) {
log.error("Deleted Exception---->>" + e.getMessage())
}
}
redirect is missing with params
. I wanted to carry forward params
on redirect
.
The URL before I clicked on 'delete' g:actionSubmit
button looks like:
http://localhost:8080/message/list?offset=10&max=100
After 'delete' g:actionSubmit
button is clicked, the url looks like (and has extra parameters:
http://localhost:8080/message/list?msgCheck=ga12%40user.com&msgCheck=&_action_domainDelete=Delete&_msgCheck=&_msgCheck=&_msgCheck=&_msgCheck=&_msgCheck=&_msgCheck=&_msgCheck=&_msgCheck=&_msgCheck=&_msgCheck=&_msgCheck=&domainId=1&noofrows=100
How do I carry forward the parameter when g:actionSubmit
button is clicked?
I don't think that you can pass
params
withactionSubmit
in this way. You can useparams
attribute of g:form tag, likeor