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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:56:03+00:00 2026-05-22T16:56:03+00:00

I have this controller: def participated = { def user = User.get(1) def temp

  • 0

I have this controller:

def participated = {

    def user = User.get(1)
    def temp = ConferenceUser.findAllByUser(user)
    def prizes = Prizes.list()

    [temp: temp, prizes: prizes]

    //redirect(action: "participated", params: params)
}

And this gsp view:

<g:each in="${temp}">

  <li>Date: ${it.dateParticipated}, <br>Role: ${it.role}, <br>Acceptence: ${it.accepted}, <br>
  <g:link controller="conference" action="participated" params="[temp: it.conference.id]">
     Conference: </g:link>${it.conference},<br>
Status: ${it.status}</li><br>

   <g:each in="${prizes.findAllByConferenceUser(temp.id)}"> ########
     PrizeName: ${it.name}
</g:each>
  <br>
</g:each>

What i want to do is, after printing all the conferenceUser objects i need, i need to print all the prizes won with that conferenceUser id. Where the ## is, there is my problem. I dont know how to do that in the controller, because ‘temp’ gives me all conferenceUser filtered by User. But i also need all prizes won filtered by conferenceUSer id. So i passed in the controller temp (which represents all the conferences with the user id = 1) And i passed all the prizes won in order to filter them in the second ‘each’ tag. But this way is not working, because, as i is now, temp.id represents multiple ids (as shown in the errors). Any help please? How can i get the id that is being used at that moment in the first each tag?

Error 500: Error evaluating expression [prizes.findAllByConferenceUser(temp.id)] on line [44]: groovy.lang.MissingMethodException: No signature of method: java.util.ArrayList.findAllByConferenceUser() is applicable for argument types: (java.util.ArrayList) values: [[50, 51, 52, 53, 54, 55, 57]]
Servlet: grails
URI: /CM/grails/conferenceUser/participated.dispatch
Exception Message: No signature of method: java.util.ArrayList.findAllByConferenceUser() is applicable for argument types: (java.util.ArrayList) values: [[50, 51, 52, 53, 54, 55, 57]]
Caused by: Error evaluating expression [prizes.findAllByConferenceUser(temp.id)] on line [44]: groovy.lang.MissingMethodException: No signature of method: java.util.ArrayList.findAllByConferenceUser() is applicable for argument types: (java.util.ArrayList) values: [[50, 51, 52, 53, 54, 55, 57]]
    Code Snippet:
  • 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-22T16:56:04+00:00Added an answer on May 22, 2026 at 4:56 pm

    ok, so you are looping thru conferences, and then trying to do a find on prize for each conference. It seems like you want a one to many relationship between Conference and Prize domain objects. If you set that up, you will not have any trouble reaching the Prizes from a given Conference.

    A few notes:

    First, never load things via 'domainObject.find...()' from gsps. Its an extremely bad practice that is only going to get you in trouble.

    Second, all database operations should really be behind services. Doing it in a controller and not in a service is not as bad as loading data from the gsp, but its not a good idea. Having services is a good idea because they wrap all your data operations in transactions, and they allow your controllers to just be controllers.

    You need to understand that Grails is a convention driven framework. It is based on MVC, which is a pattern where View concerns are kept separate from Model concerns which are kept separate from Controller concerns. If you follow those conventions, you’ll get more milage out of the framework.

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

Sidebar

Related Questions

I have a controller action that checks this.User.Identity.IsAuthenticated What do you suggest how to
I have this controller: def list = { withFormat { xml { render Customer.list()
I have this method in a controller: def article_info if @article = Article.find_by_permalink(params[:permalink]) @title
Imagine I have this scenario in my Controller: def nr_1 = params.first_nr def nr_2
I have this method in my controller def mylovelyhaus @haus = Hause.find(params[:id]) end I
I currently have this method in a controller: def show property = Property.find(params[:id]) respond_to
I have a controller with a action similar to this class EventsController < ApplicationController
I have an action like this: public class News : System.Web.Mvc.Controller { public ActionResult
I have this ruby function in a controller def updateSession value case value when
In my controller, I have this: user.save if user.leveled_up==true flash[:notice]=HOOOORAY!!! end and in my

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.