Passing Multiple parameters to remoteFunction

JavaScript in GSP page:


${remoteFunction(controller:'processParamAssign',
action:'operList',update:'operDiv',
params:'\'mfgAreaLoc=\'+mfgAreaLoc+\'&oper=\'+oper')};

In the above line I am passing mfgAreaLoc and oper as 2 parameters to the remoteFunction operList in the controller processParamAssign. NOTE: mfgAreaLoc and oper are JavaScript variables declared before the remoteFunction call is made.

The controller action looks like this:


def operList={
println "Params:"+params
println "Oper:"+params.oper
println "mfgAreaLoc:"+params.mfgAreaLoc
}

Output is:


Params:[oper:LASERM, action:operList,
controller:processParamAssign, mfgAreaLoc:VICMRKCUT]
Oper:LASERM
mfgAreaLoc:VICMRKCUT
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s