You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Fernando Wermus <fe...@gmail.com> on 2008/02/24 05:56:38 UTC

my domain model and Joda-Time

Hi all,
     I got a parser error using DateTextField.
     I am working with Joda-Time in my domain model. Thus I have some
DateTime attributes. According to this code which I found,

...
        form.add(DateTextField.forDatePattern("datetime", new
PropertyModel(this, "datetime"), "MM/dd/yyyy"));
        form.add(new DateTextField("date", new PropertyModel(this, "date"),
Date.class, new PatternDateConverter("MM/dd/yyyy", true)));
//        form.add(DateTextField.forDatePattern("date", new
PropertyModel(this, "date"), "MM/dd/yyyy"));  // will fail
...

I can use it perfectly; on the other hand, I found  this comments in
DateTextField.class too,

 * A TextField that is mapped to a <code>java.util.Date</code> object and
that uses Joda time to
 * parse and format values.

I think I am misunderstanding something. Should I use always Date attributes
instead DateTime ones, and wicket-datetime use it just for conversion, or
can I use in my wicket-models?

-- 
Fernando Wermus.

Re: my domain model and Joda-Time

Posted by Fernando Wermus <fe...@gmail.com>.
I found http://issues.apache.org/jira/browse/WICKET-466. If I understand
these path will be added in 1.4 release.
Is this correct?

On Sun, Feb 24, 2008 at 2:56 AM, Fernando Wermus <fe...@gmail.com>
wrote:

> Hi all,
>      I got a parser error using DateTextField.
>      I am working with Joda-Time in my domain model. Thus I have some
> DateTime attributes. According to this code which I found,
>
> ...
>         form.add(DateTextField.forDatePattern("datetime", new
> PropertyModel(this, "datetime"), "MM/dd/yyyy"));
>         form.add(new DateTextField("date", new PropertyModel(this,
> "date"), Date.class, new PatternDateConverter("MM/dd/yyyy", true)));
> //        form.add(DateTextField.forDatePattern("date", new
> PropertyModel(this, "date"), "MM/dd/yyyy"));  // will fail
> ...
>
> I can use it perfectly; on the other hand, I found  this comments in
> DateTextField.class too,
>
>  * A TextField that is mapped to a <code>java.util.Date</code> object and
> that uses Joda time to
>  * parse and format values.
>
> I think I am misunderstanding something. Should I use always Date
> attributes instead DateTime ones, and wicket-datetime use it just for
> conversion, or  can I use in my wicket-models?
>
> --
> Fernando Wermus.




-- 
Fernando Wermus.

Re: my domain model and Joda-Time

Posted by Fernando Wermus <fe...@gmail.com>.
I changed it. Do you know if this upgrade is comming soon?

On Sun, Feb 24, 2008 at 3:03 AM, Ryan Gravener <ry...@gmail.com>
wrote:

> Use Date instead of DateTime.
>
> On Sat, Feb 23, 2008 at 11:56 PM, Fernando Wermus <
> fernando.wermus@gmail.com>
> wrote:
>
> > Hi all,
> >     I got a parser error using DateTextField.
> >     I am working with Joda-Time in my domain model. Thus I have some
> > DateTime attributes. According to this code which I found,
> >
> > ...
> >        form.add(DateTextField.forDatePattern("datetime", new
> > PropertyModel(this, "datetime"), "MM/dd/yyyy"));
> >        form.add(new DateTextField("date", new PropertyModel(this,
> "date"),
> > Date.class, new PatternDateConverter("MM/dd/yyyy", true)));
> > //        form.add(DateTextField.forDatePattern("date", new
> > PropertyModel(this, "date"), "MM/dd/yyyy"));  // will fail
> > ...
> >
> > I can use it perfectly; on the other hand, I found  this comments in
> > DateTextField.class too,
> >
> >  * A TextField that is mapped to a <code>java.util.Date</code> object
> and
> > that uses Joda time to
> >  * parse and format values.
> >
> > I think I am misunderstanding something. Should I use always Date
> > attributes
> > instead DateTime ones, and wicket-datetime use it just for conversion,
> or
> > can I use in my wicket-models?
> >
> > --
> > Fernando Wermus.
> >
>
>
>
> --
> Ryan Gravener
> http://ryangravener.com
>



-- 
Fernando Wermus.

Re: my domain model and Joda-Time

Posted by Ryan Gravener <ry...@gmail.com>.
Use Date instead of DateTime.

On Sat, Feb 23, 2008 at 11:56 PM, Fernando Wermus <fe...@gmail.com>
wrote:

> Hi all,
>     I got a parser error using DateTextField.
>     I am working with Joda-Time in my domain model. Thus I have some
> DateTime attributes. According to this code which I found,
>
> ...
>        form.add(DateTextField.forDatePattern("datetime", new
> PropertyModel(this, "datetime"), "MM/dd/yyyy"));
>        form.add(new DateTextField("date", new PropertyModel(this, "date"),
> Date.class, new PatternDateConverter("MM/dd/yyyy", true)));
> //        form.add(DateTextField.forDatePattern("date", new
> PropertyModel(this, "date"), "MM/dd/yyyy"));  // will fail
> ...
>
> I can use it perfectly; on the other hand, I found  this comments in
> DateTextField.class too,
>
>  * A TextField that is mapped to a <code>java.util.Date</code> object and
> that uses Joda time to
>  * parse and format values.
>
> I think I am misunderstanding something. Should I use always Date
> attributes
> instead DateTime ones, and wicket-datetime use it just for conversion, or
> can I use in my wicket-models?
>
> --
> Fernando Wermus.
>



-- 
Ryan Gravener
http://ryangravener.com