Let's say I have a datePicker called foobar:
<g:datePicker name="foobar" value="${new Date()}" precision="day" />
How did I read the passed value of this date picker?
One way that works, but has some unwanted side effects, is as follows:
def newObject = new SomeClassName(params)
println "value=" + newObject.foobar
This reading method reads all the fields presented in newObject, which I want to avoid. I'm only interested in the value of the foobar field.
I suggested that this is possible:
def newObject = new SomeClassName()
newObject.foobar = params["foobar"]
But Grails does not seem to automatically translate the foobar field into a Date () object.
Updated: More information can be found in Grails JIRA .
knorv