oh yes you need to set the outputMakupId to true, here you go
TextField dateField = new TextField("dateField");
add(dateField);
final TextField updatedField = new TextField("updatedField");
updatedField.setOutputMarkupId(true);
add(updatedField);
AjaxFormComponentUpdatingBehavior behavior = new
AjaxFormComponentUpdatingBehavior("onchange")
{
protected void onUpdate(AjaxRequestTarget target)
{
testModel.setUpdatedField("newValue"); // set the new value
to the backing model repaint the component
target.addComponent(updatedField);
}
};
dateField.add(behavior);
<input wicket:id="dateField" type="text" value= "text" onchange="blah"/>
<input wicket:id="updatedField" type="text" value= "text" />
On 8/9/07, Dipu Seminlal <[EMAIL PROTECTED]> wrote:
>
> yes i am almost certain, we need to have the event in the markup.
> if you add an onchange behaviour then you must add onchange in the markup.
>
>
>
> On 8/9/07, Federico Fanton <[EMAIL PROTECTED]> wrote:
> >
> > On Thu, 9 Aug 2007 14:10:58 +0100
> > "Dipu Seminlal" <[EMAIL PROTECTED]> wrote:
> >
> > > Did you add onchange in the markup as well, you need to add it in the
> > markup
> > > as well
> > > <input wicket:id="yourDate" id="yourDate" type="text" name="yourDate"
> > > onchange="blah" />
> >
> > I'm sorry, do you mean that Wicket replaces the "blah" on the fly? I
> > thought that behaviors don't need modification to the markup.. Or maybe it's
> > needed just for DateFields?
> > I'll try with your suggestion though, many thanks :)
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>