On 5/4/07, Cosma <[EMAIL PROTECTED]> wrote:
> I have some fields that I want to validate "on the fly", so I've bound
> the following method to a button click:
>
> private var validateThisStep():Boolean {
> var myValidator:Validator = new Validator();
> myValidator.source = aTileList;
> myValidator.property = "selectedItem";
> myValidator.required = true;
> myValidator.requiredFieldError = "Pick an item";
> var result:ValidationResultEvent = myValidator.validate();
> if (!result.results) {
> return true;
> } else {
> return false;
> }
> }
>
> This seems to work.. but then, every time I refresh the aTileList, for
> example doing this:
> The validator is again executed (obviusly failing). Why does this
> happens?
I'm not sure, but have you tried setting source to null once you're
done with the validation?