【发布时间】:2014-11-21 11:29:57
【问题描述】:
不幸的是,我找不到任何使用 Grails 字段插件的好例子。 在我的应用程序中,我希望将某些字段呈现为不同类型,如文本区域或稍后的 CKE 编辑器。我的域名:
class Case {
String description
}
我创建了一个插件可以找到的 _input.gsp: INFO formfields.FormFieldsTemplateService - 找到模板 /patchCase/description/input
它包含:
<f:field bean="Case" property="description">
<g:textArea name="description" cols="40" rows="5" maxlength="5000" value="some default text"/>
</f:field>
但是我得到了
ERROR errors.GrailsExceptionResolver - NotReadablePropertyException occurred when processing request: [GET] /M3PatchManage/patchCase/create
Invalid property 'description' of bean class [java.lang.String]: Bean property 'description' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?. Stacktrace follows:
Message: Error processing GroovyPageView: Error executing tag <g:form>: Error executing tag <f:all>: Error executing tag <f:field>: Invalid property 'description' of bean class [java.lang.String]: Bean property 'description' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
谁能描述一下如何使用字段的自定义或者给出一个描述好的链接(插件文档很薄)?
我正在使用 Grails 2.4。
【问题讨论】:
标签: templates grails plugins field