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

  • Home
  • SEARCH
  • 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 8548887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:36:06+00:00 2026-06-11T13:36:06+00:00

I am trying to get every instance of a domain where there user is

  • 0

I am trying to get every instance of a domain where there user is equal to current logged in user.
My code at the minute is:

def list(Integer max) {
    params.max = Math.min(max ?: 10, 100)
    if (lookupPerson().username == "admin"){
         adminList(max)
    }
    else{

        def childList = []
        def i = 1
     Child.list().each(){
         if(Child.get(i).user.username == lookupPerson().username){
             def child = Child.get(i)
             childList.add(child)
         }
          i++
     }
        [childInstanceList: childList.list(params), childInstanceTotal: childList.count()]
    }


}

This gives me the following error
No signature of method: java.util.ArrayList.list() is applicable for argument types: (org.codehaus.groovy.grails.web.servlet.mvc.GrailsParameterMap) values: [[action:list, controller:child, max:10]] Possible solutions: last(), first(), asList(), toList(), is(java.lang.Object), wait()

I’m sure there must be an easier and better way of doing this.
any ideas?

  • 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-11T13:36:08+00:00Added an answer on June 11, 2026 at 1:36 pm

    You can probably do what you’re after with a criteria query:

    def childList = Child.createCriteria().list(params) {
      user {
        eq('username', lookupPerson().username)
      }
    }
    

    If your params has pagination parameters then the “total” will be available as childList.totalCount, you don’t need to calculate it separately.

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

Sidebar

Related Questions

In grails I am trying to get every instance of a domain called Child
I am trying to get a timer run every minute in sync with the
I am trying to display every odd instance of a table row, however there
I'm trying to get every widget to scale with change in window size. I
Hello every One i am trying to get Ist date of All months in
I'm trying to get a JProgressBar to increment by 1 every 100th of a
When trying to get geolocation on iPhone the first time - I declined. Every
i'm trying to get started with silverlight 2. i have a weird bug. every
I am trying to get the most occurring term frequencies for every particular document
i am getting this error on every page where i am trying to get

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.