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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:14:01+00:00 2026-06-12T17:14:01+00:00

I am currently working on a Grails project and would like to know the

  • 0

I am currently working on a Grails project and would like to know the best way of showing a select list of objects from the Spring Security domain model:

I know how to create a select list but I just want to find out the best way within grails to populate it with the objects from that domain. I was thinking of calling something like “user.list(params)” and then passing that to the view, I could then access the defined object within that domain, but im not 100% sure wether that is the best way or if it can be done that way?

Thanks in advance

EDIT…..

I have the following custom model setup in the controller:

class UserModel {
           String username
           String firstName
           String lastName

           def email = User.email.list()
           String[] emails = email

           static constraints = {
                username blank: false
                firstName blank: false
                lastName blank: false

           }
}

Then when the index page for this view is initialized I pass this to it:

[model: new UserModel(copy)]

and finally on the view i have this:

<g:select name="emails" from="${model.emails}"

Now when I run the application I get this error:

No signature of method: grails.plugins.springsecurity.ui.UserModel.propertyMissing() is applicable for argument types: () values: [] Possible solutions: propertyMissing(java.lang.String)

Can anyone please help with this?? Thanks

  • 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-12T17:14:02+00:00Added an answer on June 12, 2026 at 5:14 pm

    I have been working hard at this and have implemented a solution for the issue I was having and it all works fine. Below is what I have in my controller for the view in question:

    def index = {
            [userList: Users(), command: new RegisterCommand(copy)]
        }
    
    protected List Users() {
            lookupUserClass().list()
        }
    

    The List Users calls another function from an extended class which is shown below:

    protected Class<?> lookupUserClass() {
            grailsApplication.getDomainClass(lookupUserClassName()).clazz
        }
    

    This view then renders the list of items that I want to show in a select list:

    <g:select name="emails" from="${userList.emails}" />
    

    You can also do this if you are looking for unique values:

    <g:select name="emails" from="${userList.emails.unique()}" />
    

    Thanks

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

Sidebar

Related Questions

I am currently working on grails project. I have created eight different plugins. Each
I am currently working on a grails project where I need to execute a
I'm currently working on a project using netbeans 6.9 and grails 1.3. I'm trying
Im currently working with OpenGL in iOS and i would like to hear if
Currently working on a project to upgrade our Goole Maps API from v2 to
I am currently working on a grails project right now where I needed to
I am currently working on a grails project. I've created an enum located on
I am now currently working on a grails project . I have a problem
I'm a newbie on grails. I am now currently working on my scaffolding templates
I am currently working with User objects -- each of which have many Goal

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.