0

How to pass all parameters with a grails remoteLink. I've tried a lot of thing but did not manage to get it working....

<g:remoteLink action="show" update='resultset' method="post" params="[params:params]">Testing</g:remoteLink>


<g:remoteLink action="show" update='resultset' method="post" params="[params:${params}]">Testing</g:remoteLink>
Jacob
  • 3,580
  • 22
  • 82
  • 146

2 Answers2

2

Try:

<g:remoteLink action="show" update='resultset' method="post" params="${params}">Testing</g:remoteLink>

Params is a Map already, so you don't need to do anything special.

Igor Artamonov
  • 35,450
  • 10
  • 82
  • 113
  • The parameters get set. But the link doesn't work correctly... It reloads the whole page instead of only the div specified in the update propertie. Actually the ajax doesn't get called only the link is followed. – Jacob Jul 03 '13 at 08:03
  • If I enter a param manual like: params="offset:12" it works! Another thing if I remove method="post" I get an error in console: [10:06:58.806] SyntaxError: missing ] after element list @ – Jacob Jul 03 '13 at 08:08
  • what you get in html as a result? btw, does it really use `offset:12`? it's not a map, just a string. – Igor Artamonov Jul 03 '13 at 08:13
  • I have some dojo.preventCache in my params maybe this is causing ajax to fail! – Jacob Jul 03 '13 at 08:27
  • Another thing: How can I add another parameter in addition? – Jacob Jul 03 '13 at 13:41
  • You can use `params="${params + [newparam: avalue]}"` – Igor Artamonov Jul 03 '13 at 15:11
0

Dojo.preventCache was messing up with my AJAX. When I removed it started working. Prevent cache in every Dojo xhr request on page

Community
  • 1
  • 1
Jacob
  • 3,580
  • 22
  • 82
  • 146