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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

python - Django-cities exits with "killed" -

python - How to get a widget position inside it's layout in Kivy? -