开发者

grails datePicker data binding

开发者 https://www.devze.com 2022-12-19 06:04 出处:网络
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

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 b开发者_开发百科ound 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


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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号