i dont think values changed via js send out onchange events. you will
probably need to hook into the datepicker javascript and invoke
onchange explicitly. fortunately yui stuff has a pretty good event
system that widgets use, so plugging into it should probably not pose
a huge problem.
-igor
On Fri, Mar 14, 2008 at 9:56 AM, Stephan Koch
<[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I'm currently having some trouble with a DateTextField. The
> DateTextField has a DatePicker component attached to it.
> Once the user changes the date with the DatePicker, the attached
> DateTextField is assigned the new date and should trigger the onChange
> event. Which it doesn't do....
>
> Everything works fine if the date is changed by typing directly it into
> the textfield. Any ideas?
>
>
>
>
> DateTextField dtf = DateTextField.forShortStyle("dateField", new
> PropertyModel(this, "date"));
>
> dtf.add(new DatePicker());
>
> OnChangeAjaxBehavior dateOnChange = new OnChangeAjaxBehavior() {
>
> @Override
> protected void onUpdate(AjaxRequestTarget target) {
> log.debug("dateField onChange event triggered.");
> // do some stuff with the date here...
> }
>
> };
>
> dtf.add(dateOnChange);
> add(dtf);
>
>
> --Stephan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]