You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Viktoras <it...@gmail.com> on 2011/07/07 21:59:46 UTC

Optional validation

Hi list,

I've got  an "edit account" window, where administrator/account owner 
can optionally change password, that is:
* if he intents not to change his current password, he leaves "password" 
and "confirm password" fields empty;
* to change password, standart form validators should apply, that's 
where i'd like to use EqualPasswordInputValidator and PatternValidator.

Currently i solved it by just writing my own form validator, but it 
seems like all i'm doing is rewriting those standard validators with an 
emtpy field check before that. Is there a better approach to this?

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


Re: Optional validation

Posted by Igor Vaynberg <ig...@gmail.com>.
validators are not called if the fields are left blank...

-igor

On Thu, Jul 7, 2011 at 12:59 PM, Viktoras <it...@gmail.com> wrote:
> Hi list,
>
> I've got  an "edit account" window, where administrator/account owner can
> optionally change password, that is:
> * if he intents not to change his current password, he leaves "password" and
> "confirm password" fields empty;
> * to change password, standart form validators should apply, that's where
> i'd like to use EqualPasswordInputValidator and PatternValidator.
>
> Currently i solved it by just writing my own form validator, but it seems
> like all i'm doing is rewriting those standard validators with an emtpy
> field check before that. Is there a better approach to this?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

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