grails - Append to query-string with the same key -
i trying add parts query-string same key.
i have url http://server.com/search/result?query=hello controls should add collaborator query-string.
this done this:
<g:link action="result" params="${params + ['collaborator': collaborator.id]}">${collaborator.name}</g:link> which returns: http://server.com/search/?query=hello&collaborator=<id>.
this good, possible choose more collaborators. how append &collaborator=<id> query?
i have tried various methods ${params + [params.collaborator + collaborator.id]}, puts them in 1 string.
try this:
gsp:
<g:link action="result" params="${params + ['collaborator': params.list('collaborator') + [collaborator.id]]}">${collaborator.name}</g:link> action:
list collaboratorlist = params.list('collaborator') //your operations on list
Comments
Post a Comment