[CLOSED] B5 - validator returns isvalid ??

[CLOSED] B5 - validator returns isvalid ??

When calling isValid against a FormPanel, any fields with a custom validator are not checked correctly.

The snippet below shows problem...

1) Enter values for all but last field (password2 - which has the custom validator)

2) click check and it returns True suggesting all fields have been checked for isvalid - clearly password2 did not have its isvalid correctly called??

Looking at the GXT source I think the overridden validateValue(..) method needs an extra condition to consider if the validator is used (as it may be ok for the value length to be < 1)

Perhaps consider moving the validator check to the top as if one is set, the other validators are kinda not needed (true?) - maybe add docs to say "if you set a validator, it will be called before all other set validations etc"

TextField defaults with allowBlank to true. So when the validation is run and the field is empty, it passes validation and the validate method will not be called. If you do not want to allow blank values then call setAllowBlank(false) just as you did with password 1 field.

no, this is not right - cases where you want to custom validate (regardless of allow blank etc) should be allowed (one example is where you want to compare passwords or and blank is acceptable, but only if another field is also blank).

Thanks

Thanks

Originally Posted by darrellmeyer

TextField defaults with allowBlank to true. So when the validation is run and the field is empty, it passes validation and the validate method will not be called. If you do not want to allow blank values then call setAllowBlank(false) just as you did with password 1 field.

Thank you for your kind information. I wasted 2hours with that.
your message is cleared.