views:

288

answers:

1

Hi,

I've create a modified version of Grails' datePicker tag. It uses exactly the same parameters as the Grails datePicker, but for some reason the Date property of the object that these parameters are bound to is not being set.

This class has a property start of type Date and the parameters that are being sent are

  • start_year
  • start_month
  • start_day
  • start_hour
  • start_minute

which are exactly the same as those used by the Grails datePicker. Is there a reason why these would bind to a Date property when the Grails datePicker is used, but not mine?

Thanks, Don

+2  A: 

Hi Don,

You need an extra field hidden called "start" with the value "date.struct" otherwise Grails will not recognize your date fields. Check out the <g:dateField> output, to see all the fields needed.

/Søren

sbglasius
The hidden field should ofcourse be named, whatever your Date field in your domain/command object is named.
sbglasius
Thanks Søren, but I already have that field
Don
hmmm. odd. Because I have made a small taglib for a jQuery date-picker and it works. At some point I plan to release it, but for now, please let me know if you want the code
sbglasius