Yes, that does work for DateTextField. But i am using the DateField
component which is a combination of DateTextField and DatePicker

Ryan

On Mon, Jul 20, 2009 at 8:25 PM, Mathias Nilsson <
wicket.program...@gmail.com> wrote:

>
>
> import java.util.Date;
>
> import org.apache.wicket.ajax.AjaxRequestTarget;
> import org.apache.wicket.ajax.form.AjaxFormComponentUpdatingBehavior;
> import org.apache.wicket.extensions.markup.html.form.DateTextField;
> import org.apache.wicket.markup.html.WebPage;
> import org.apache.wicket.markup.html.form.Form;
> import org.apache.wicket.model.Model;
>
> /**
>  * Homepage
>  */
> public class HomePage extends WebPage{
>
>        private static final long serialVersionUID = 1L;
>          protected DateTextField dateField;
>    public HomePage() {
>
>
>                   Form<Void> form = new Form<Void>( "form" );
>
>                dateField = new DateTextField("date", new Model<Date>(new
> Date()));
>
>                dateField.add(new
> AjaxFormComponentUpdatingBehavior("onchange")
> {
>                                         private static final long
> serialVersionUID = 1L;
>
>                                         @Override
>                    protected void onUpdate(AjaxRequestTarget arg0) {
>                         Date d = dateField.getModelObject();
>                        System.out.println( d );
>                    }
>
>                });
>
>                form.add( dateField );
>                add( form );
>
>
>
>    }
>
>
>
>
> }
> --
> View this message in context:
> http://www.nabble.com/How-to-get-DateField-value-tp24567634p24574979.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
>
>

Reply via email to