问题
Can you tell me the list of valid values for the widget constraint below (some-widget), e.g.:
static constraints = {
someField(widget: 'some-widget')
}
The documentation seems to be missing. Related, do you know of any plugins that can work directly with this constraint?
回答1:
You can have a look there
It's an old list, but it's still valid, I think
回答2:
From what I can tell, the widget
property is only used for scaffolding and is referenced in the renderEditor.template. In that file, it appears that the widget property has some pretty narrow uses depending on the type of object you are scaffolding.
The good news, however, is that you can supply your own renderEditor.template
file and edit it to work however you want. Just create a file at ${basedir}/src/templates/scaffolding/renderEditor.template
and Grails will pick it up when you generate the views.
(See DefaultGrailsTemplateGenerator for more information.)
来源:https://stackoverflow.com/questions/7295811/what-widget-constraints-are-valid-for-grails-domain-classes