【发布时间】:2014-06-02 16:02:25
【问题描述】:
我的域中有以下内容
boolean checkbox1
boolean checkbox2
boolean checkbox3
static constraints {
checkbox1(blank: true, nullable: true)
}
现在当我保存时,在我看来,我没有为 checkbox1 设置任何值,我收到以下错误:
- 字段“checkbox1”上的对象“com.smstool.myDomain”中的字段错误:拒绝值 [false];代码 [typeMismatch.com.myApp.myDomain.checkbox1,typeMismatch.checkbox1,typeMismatch.boolean,typeMismatch]
我的看法是:
<g:checkBox name="${domainReference}checkbox1" value="${thisInstance?.checkbox1}" class="myCheckbox" />
我不明白为什么会这样?当然,如果我有 blank: true 和 nullable: true 那么这应该忽略不匹配吗?
【问题讨论】: