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 -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -