i just tried with the date picker on 1.2.6 and it works, don't know if
anything has changed drastically in 1.3

see the code below

DatePickerSettings datePickerSettings = new DatePickerSettings();
        datePickerSettings.setIfFormat("%d/%m/%Y");
        datePickerSettings.setStyle(datePickerSettings.newStyleAqua());





         TextField dateField = new TextField("dateField");
         add(dateField);
         add(new DatePicker ("datePicker",dateField));

         final TextField updatedField = new TextField("updatedField");
         updatedField.setOutputMarkupId(true);
         add(updatedField);

         AjaxFormComponentUpdatingBehavior behavior = new
AjaxFormComponentUpdatingBehavior("onchange")
         {

            private static final long serialVersionUID = 1L;

            protected void onUpdate(AjaxRequestTarget target)
            {
                testModel.setUpdatedField(testModel.getDateField());
                target.addComponent(updatedField);

            }

         };
         dateField.add(behavior);


<input wicket:id="dateField" type="text" value= "text"
onchange="blah"/><span wicket:id="datePicker"></span>
<input wicket:id="updatedField" type="text" value= "text" />


On 8/9/07, Federico Fanton <[EMAIL PROTECTED]> wrote:
>
> On Thu, 9 Aug 2007 15:34:03 +0100
> "Dipu Seminlal" <[EMAIL PROTECTED]> wrote:
>
> > oh yes you need to set the outputMakupId to true, here you go
> >
> > TextField dateField = new TextField("dateField");
>
> D'oh! I'm sorry, I fear I didn't explain myself properly :( The
> "DateField" I'm using is the date picker widget used by Wicket 1.3.. It's
> a FormComponentPanel made of a textfield and an icon which - when clicked -
> pops up a calendar.. So, I attached my behavior to the textfield and it
> works when I change the textfield directly, but I don't know how to
> intercept when _the calendar_ changes the textfield..
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to