Re: Prepopulate time fields in DateTimeField component
Is there any way to reapply the relationship checkinDate had with the CompoundPropertyModel? -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Prepopulate-time-fields-in-DateTimeField-component-tp2533175p2534425.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Prepopulate time fields in DateTimeField component
Hi all, I have a Form with the default model being a CompoundPropertyModel. I have added the DateTimeField component to the form. I wish to prepopulate the time fields but not the date. I have tried a few different things but all have their various issues. Anyone have any ideas? Many thanks in advance. Vishal -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Prepopulate-time-fields-in-DateTimeField-component-tp2533175p2533175.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Prepopulate time fields in DateTimeField component
put the date value you want prepopulated into the model object -igor On Thu, Sep 9, 2010 at 9:20 AM, vp143 vishal.po...@cipriati.co.uk wrote: Hi all, I have a Form with the default model being a CompoundPropertyModel. I have added the DateTimeField component to the form. I wish to prepopulate the time fields but not the date. I have tried a few different things but all have their various issues. Anyone have any ideas? Many thanks in advance. Vishal -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Prepopulate-time-fields-in-DateTimeField-component-tp2533175p2533175.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Prepopulate time fields in DateTimeField component
I tried that previously but then the field becomes NULL within the POJO I think this is what you mean: If i have: setDefaultModel(new CompoundPropertyModel(Item)); where Item object contains checkinDate field I create the component: DateTimeField checkinDateField = new DateTimeField(checkinDate, new Model(new Date())); This populates the Date and Time fields. However, I do not want the Date field to be populate, and when submitting the Item object checkinDate is NULL. I think this is because it has lost the association with the CompoundPropertyModel. Many thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Prepopulate-time-fields-in-DateTimeField-component-tp2533175p2533314.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org
Re: Prepopulate time fields in DateTimeField component
Item.checkinDate=new Date() -igor On Thu, Sep 9, 2010 at 10:52 AM, vp143 vishal.po...@cipriati.co.uk wrote: I tried that previously but then the field becomes NULL within the POJO I think this is what you mean: If i have: setDefaultModel(new CompoundPropertyModel(Item)); where Item object contains checkinDate field I create the component: DateTimeField checkinDateField = new DateTimeField(checkinDate, new Model(new Date())); This populates the Date and Time fields. However, I do not want the Date field to be populate, and when submitting the Item object checkinDate is NULL. I think this is because it has lost the association with the CompoundPropertyModel. Many thanks -- View this message in context: http://apache-wicket.1842946.n4.nabble.com/Prepopulate-time-fields-in-DateTimeField-component-tp2533175p2533314.html Sent from the Wicket - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org - To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org For additional commands, e-mail: users-h...@wicket.apache.org