You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Steve Mactaggart <st...@whitesquaresoft.com> on 2010/06/02 09:31:27 UTC

Re: FormComponentPanel's components onblur can't call validate?

Sorry to dredge up this thread again,but I have the same issue.

I have a form that has a hidden id and a text field that is a "search" box
for elements.  I have got all the client side javascript working so that the
name and Id are updated in the page, and also have it doing the convertInput
correctly and the component is working as expected on a standard form.

But when I add the AjaxFormComponentUpdatingBehavior it starts going wrong.

what I am doing is catching the add(AjaxFormComponentUpdatingBehavior) on my
FormComponentPanel and attaching it to the internal text "name" box.
When the JS changes the id and name it triggers the event which works, but
the issue is that the AFCUB only submits the name textbox and not the id.

Is there anyway (or another behaviour other than AjaxFormSubmitBehavior)
that I can use to force BOTH inputs to be updated on the event?

Cheers,
Steve


On Wed, Mar 10, 2010 at 6:55 PM, Cemal Bayramoglu <
jWeekend_forums@cabouge.com> wrote:

> Tony,
>
> If you don't mind submitting the whole form add
> "AjaxFormSubmitBehavior"s to the appropriate child components .
>
> Regards - Cemal
> jWeekend
> OO & Java Technologies, Wicket
> Consulting, Development, Training
> http://jWeekend.com
>
>
> On 9 March 2010 23:52, Tony Wu <e9...@gmail.com> wrote:
> > I have a FormComponentPanel which holds 3 dropdowns for month-day-year
> (it's
> > a birthday FormComponentPanel). I override convertInput on the
> > FormComponentPanel to return the age based on the 3 drop downs. I have an
> > age validator which makes sure they're over 18.
> >
> > Now, this all works fine on form submit (convertInput gets called and it
> > runs the validator).
> >
> > But when I try to do it dynamically by attaching a onchange
> > AjaxFormUpdatingBehavior event to the 3 drop downs to call
> > FormComponentPanel.validate() (@Override onUpdate, and only when all 3
> drop
> > downs are selected of course), I know the onchange triggers (because it's
> > @Override onUpdate runs - had a system.out.println which runs), but the
> > validate() function doesn't run the age validator. It actually *never
> even
> > calls convertInput* on the FormComponentPanel. Any ideas?
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>