简体   繁体   English

grails datePicker数据绑定

[英]grails datePicker data binding

I've create a modified version of Grails' datePicker tag. 我已经创建了Grails的datePicker标记的修改版本。 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. 它使用与Grails datePicker完全相同的参数,但是由于某些原因,未设置这些参数绑定到的对象的Date属性。

This class has a property start of type Date and the parameters that are being sent are 此类的属性start类型为Date ,正在发送的参数为

  • start_year start_year
  • start_month start_month
  • start_day start_day
  • start_hour start_hour
  • start_minute start_minute

which are exactly the same as those used by the Grails datePicker. 与Grails datePicker所使用的完全相同。 Is there a reason why these would bind to a Date property when the Grails datePicker is used, but not mine? 当使用Grails datePicker而不使用我的Grails datePicker时,为什么将这些绑定到Date属性?

Thanks, Don 谢谢唐

You need an extra field hidden called "start" with the value "date.struct" otherwise Grails will not recognize your date fields. 您需要隐藏一个名为“开始”的额外字段,其值为“ date.struct”,否则Grails将无法识别您的日期字段。 Check out the <g:dateField> output, to see all the fields needed. 检出<g:dateField>输出,以查看所需的所有字段。

/Søren /索伦

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM