You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by David Rosenstrauch <da...@darose.net> on 2007/07/31 17:12:25 UTC
Re: [Wicket-user] How to set a date on backing model obj from contents
of drop down lists?
David Leangen wrote:
> One suggestion: what about having a date pojo like:
>
> public class MyDate
> {
> get/setMonth()
> get/setDay()
> get/setYear()
>
> public Date getDate()
> {
> // translate object state into a Date object
> }
> }
>
>
> Then use PropertyModel to get/set the individual fields:
>
> Component myComponent = new WhateverComponent( "id", new
> PropertyModel( myDate, "fieldOfDate" );
>
>
> That should work.
>
>
> Maybe more experienced people know of a more elegant way, though this
> way's not so bad.
>
>
> Cheers,
> Dave
That's how I would do it.
DR
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org