Typing in input directly works (it should)? Must be related to the
javascript datepicker component.

Eelco


On 9/29/05, Troy MacNeil <[EMAIL PROTECTED]> wrote:
> I'm having a small but frustrating problem saving dates from a form. I
> enter them in the format m/d/yyyy (this is the format returned by the
> TypeValidator ${format}) using a DatePicker component but when the model
> is saved the day and year are correct but the month is always '01'.
>
> Setting the date to today in onSubmit() works correctly, so it isn't a
> persistence problem but a parsing problem?
>
> Code snippets are below, thanks for any suggestions...
>
> Troy
>
> Original code:
>
> RequiredTextField eventDate = new RequiredTextField("eventDate",
> Date.class);
> add(eventDate);
> add(new DatePicker("eventDatePicker", eventDate));
>
> public void onSubmit() {
> SimpleEvent event = (SimpleEvent)getModelObject();
> ((VSecureRequestCycle)getRequestCycle()).getDao().merge(getModelObject());
> setResponsePage(new Schedule("The event has been added."));
> }
>
> Setting the Date directly works:
>
> public void onSubmit() {
> SimpleEvent event = (SimpleEvent)getModelObject();
> event.setEventDate(new Date());
> ((VSecureRequestCycle)getRequestCycle()).getDao().merge(event);
> setResponsePage(new Schedule("The event has been added."));
> }
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by:
> Power Architecture Resource Center: Free content, downloads, discussions,
> and more. http://solutions.newsforge.com/ibmarch.tmpl
> _______________________________________________
> Wicket-user mailing list
> Wicket-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/wicket-user
>


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to