Tuesday, May 4, 2010

passing javascript parameters with remoteFunction

There have been a lot of examples where I needed to pass javascript variables through a remoteFunction in order to Ajax-Update a part of my web application.

I had almost given up when I found the solution in a blog entry. I wasn't able to guess the correct escaping of ' signs on my own, but this solution obviously got it right:

${remoteFunction(controller:'myController',
action:'someAction',update:'targetDiv',
params:'\'oneParameter=\'+jsOneParameter+\'&anotherParameter=\'+jsSecondParameter')};

No comments:

Post a Comment