Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 753853
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:56:41+00:00 2026-05-14T14:56:41+00:00

I have a feeling that the answer to this is easy but I can’t

  • 0

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].

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T14:56:42+00:00Added an answer on May 14, 2026 at 2:56 pm

    it is quite easy

     return retVal as JSON
    

    Just remember to import org.grails.converters.JSON (I think it is)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a feeling that I already know the answer to this one, but
I have a feeling that this question is very simple, but I just can't
I have a bad feeling that the answer to this question is no, but
I have a feeling that this query is pretty easy to construct, I just
I have a feeling I may already know the answer to this question, but
I have a feeling that this probably is not possible using strictly CSS, but,
I have a feeling there is a simple answer to this, but I am
I have a feeling I know the answer to this question, but I figure
OK, this feels like a question that should be easy to answer, but as
I get the feeling that the answer might be a duplicate of this: Jackson

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.