Grails GSP g:select constraints.inList doesn't exist anymore?

Viewed 27

Migrating an older Grails project to 5.x, I found, that every

Domain:

static constraints = {
    myField inList: [1, 2, 3, 4, 5, 9]
}

GSP:

<g:select ... from=${MyDomain.constraints.myField.inList} ... />

doesn't work anymore.

Is there a way to replace it? Or how should I replace it?

BTW.: If a Grails-Maintainer read this, I would avoid using the field-plugin in standard-configuration. For new users etc. I think it's a lot easier to modify the pages like in grails 1+2. YMMV...

1 Answers

Seems that the logic has changed in the meantime.

The questioned behaviour could be achieved with the following code:

<g:select ... from=${MyDomain.constrainedProperties.myField.inList} ... />
Related