是否可以使用域<select>
constraints
的选项
static constraints = {
variable(inList: ["value1", "value2", "value3"])
}
答案 0 :(得分:4)
您可以通过以下方式访问列表:
YourClass.getConstrainedProperties().yourProperty.inList
您可以在g:each
循环中使用此选项来创建您的选择选项或使用g:select
标记:<g:select from="${YourClass.getConstrainedProperties().yourProperty.inList}" />