grails - Not sure if I have an issue with blank constraint or Dynamic Scaffolding -
i have simple domain class has few properties. want allow 1 of them empty. using blank:true in constraints block.
in config.groovy have set convertemptystringstonull=false. believe keep form submission setting blank field null , submit failing on implicit nullable check.
i using dynamic scaffolding in controller.
i have added data via bootstrap.groovy. 1 record has blank field , saves expect.
i launch app , list shows bootstapped records, including 1 blank field.
when try create new record, property accepts blanks, getting "please fill out field" validation error. believe record should save.
i'm not sure if issue scaffolded view, issue blank constraint, or me not understanding how these features should work.
any appreciated.
i guess entry in config.groovy is:
grails.databinding.convertemptystringstonull = false
the scaffolding plugin not take configurationoption account , scaffolded view _form.gsp contains required="" attribute
<g:textfield name="name" required="" value="${fooinstance?.name}"/>
you need remove
required=""
resulting in
<g:textfield name="name" value="${fooinstance?.name}"/>
so browser lets enter empty value.
Comments
Post a Comment