Liam Clarke-Hutchinson wrote:
I use an AjaxFormComponentSubmittingBehavior onblur for each field -
so it triggers the submission processing behaviour (including
validation) for the given field - although it updates the model. You
could use an applicable Ajax behaviour and then call the component's
validate() method if you wanted to avoid the model update.

Regards,

Liam Clarke

On Fri, Apr 24, 2009 at 3:50 PM, Jason Wang <jason.w...@bulletin.net> wrote:
Hi all,

I have a form with a couple form components, most of which have validators
attached. For example, the mobile number input field has a patternValidator
attached:

mobile.add(new PatternValidator("^[1-9]([0-9]{8,14})"));

I have hooked all the validation actions with "onblur" events using this:

AjaxFormValidatingBehavior.addToAllFormComponents(signUpForm, "onblur",
Duration.ONE_SECOND);

But unfortunately all the validations are triggered as soon as the focus
leaves any of the form component.

Is there a way to hook the validator(like the patterValidator) with the
event(onblur for example) on the form component(the mobile filed) rather
than the whole form?

It would be nice that the AjaxFormValidatingBehavior class could provide the
option to trigger the validations on events on every components.

Thanks.

Jasonw



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Thanks for the reply. I think you meant "AjaxFormComponentUpdatingBehavior <http://wicket.apache.org/docs/1.4/org/apache/wicket/ajax/form/AjaxFormComponentUpdatingBehavior.html>".

I will give it a try. Any other options to discuss?

Regards,
Jasonw

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to