Hi,
I have a feeling that the answer to this is easy but I can't seem to get it yet...
I have a Javascript function that calls an action in a Groovy class via a remoteFunction. Now, I need to return the value from the action class back to the Javascript function for further processing. It looks something like this:
// sample js function in the gsp file
function setPrev() {
...
var tmp = $remoteFunction(action: 'someaction', params: ...)
...
}
In the controller, the action would look something like this:
def someaction = {
...
def retVal = Somedomain.anobject // 1:m relationship so there's a hasMany = [anobject...] in Somedomain
...
return retVal
}
Now, when it returns to tmp, it's [object object]. Is there a way for me to get, at the very least, [anobject1, anobject2, ..., anobjectn] as the value of tmp? I've even tried json but it's still [object object].