What widget constraints are valid for Grails domain classes?

只谈情不闲聊 提交于 2019-12-21 17:09:14

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!