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 8257303
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:09:18+00:00 2026-06-08T02:09:18+00:00

I have this problem in my view area wherein I have this <g:select> tag

  • 0

I have this problem in my view area wherein I have this <g:select> tag having an onChange attribute to retrieve the data referenced to the selected value of the said tag. Unfortunately, we’ve containted the <g:select> tag inside the <g:formRemote> so that the data will be retrieved via the URI of the <g:formRemote> without having to refresh the page.

<!-- The g:formRemote of the view -->
<g:formRemote name="formRemote" uri:[controller:'test', action:'functionCall']>
   <g:select name="selectedValue" from="${['AA','BB']}"/>
   ${returnData}
</g:formRemote>

//The closure where the formRemote will be calling [TestController.functionCall]
def functionCall(){
   println 'entered'
   def returnData = ''
   if(params.value == 'AA')
      returnData = 'aaa'
   else if(params.value == 'BB')
      returnData = 'bbb'       

   [data:returnData]
}

The problem is we can’t find a way to retrieve the model data from the controller back to the view [in reference with <g:formRemote>] upon change of value of <g:select>.

  • 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-06-08T02:09:21+00:00Added an answer on June 8, 2026 at 2:09 am

    We recenlty know that we didn’t need a <g:formRemote> tag to have the theory to work. We lack the onChange="${remoteFunction ...}" parameter to the <g:select tag> following the format below:

    <g:select 
       name="selectedValue"
       from="${['AA','BB']}" 
       optionKey="<the id of the model with reference to line#9>"
       onChange="${remoteFunction(
         controller:'test', 
         action:'functionCall',
         update:[success:'updateDiv'],
         params:'\'id=\' + escape(this.value)',
         onComplete='displayVal(this)')}"/>
    

    Where the updateDiv,also located in the .gsp, is responsible of holding the view to be render from the controller with the closure functionCall.

    <div id="updateDiv"></div>
    

    And the TestController.functionCall having this contents:

    def functionCall(){
       println 'entered'
       def returnData = ''
       if(params.value == 'AA')
          returnData = 'aaa'
       else if(params.value == 'BB')
          returnData = 'bbb'       
    
       render(view:'<can be a template or an html page>', model:[data:returnData])
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this problem when i try to synchronize a observable list with listbox/view
Im create this code to store page view in database, but i have problem
I have this problem having to display my jasper report on my grails application.
I have a main view and the URL for this view has a Action/Controller/Area
I have one view page (MyView.aspx) and many data sources to bind on this
I have this problem: I want to generate a new source code file from
I have this problem: $id is id for each user $img = 'http://www.somesite.com/pictures/'; $no_img
I have this problem since I'm beginning in OOP programming I want to close
I have this problem when I run SAS 9.2 on the command line on
I have this problem, when I load my form, the validation messages appears in

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.