History | Log In     View a printable version of the current page.  
Issue Details (XML)

Key: SDK-9408
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: C C
Assignee: Kishan Venkataramana
Reporter: Beta App
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Flex SDK

[customer] Validator.ValidateAll() fails if any validator in array is disabled

Created: 11/30/06 06:35 AM   Updated: 08/01/07 11:40 PM
Component/s: Validators
Security Level: Public (All JIRA Users )

Issue Links:
Duplicate
 
This issue is duplicated by:
SDK-12024 RTE with validators when Validator.en... None Closed
SDK-11121 When array of validators is passed to... C Closed

Severity: Incorrectly Functioning
Reproducibility: Every Time
Found in Version: SDK Moxie M3 (Beta 2)
Milestone: SDK Moxie M3 (Beta 2)
Affected OS(s): Windows - XP
Steps to Reproduce:
Reprodution:

1. Create basic flex project
2. Add 2 textInputs
3. Add 2 StringValidators (valid1, valid2) each one pointing to a textInput
4/ add 1 button with a click='clickHandler()'
5. in code:

import mx.validators.Validator;
private var myValidator:Array
add function to run on initialize of application:
private function initApp():void{
  myValidators=[valid1, valid2];}
also add:
private function clickHandler():void{
Validator.ValidateAll(myValidators);
}

6. run this, should work fine. now add enabled='false' attribute to one of the stringvalidators. Run again. You get this error:

Actual Results:

RTE: Cannot access a property or method of a null object reference.

Expected results: no RTE

Workaround:
this is a pretty easy fix to the static method ValidateAll():

public static function validateAllEnabled(validators:Array):Array
    {
        var result:Array = [];

var n:int = validators.length;
        for (var i:int = 0; i < n; i++)
        {
            var v:Validator = Validator(validators);
           
if(v.enabled){//added this if clause
            var resultEvent:ValidationResultEvent = v.validate();
           
if (resultEvent.type != ValidationResultEvent.VALID)
                result.push(resultEvent);
        }
        }
       
return result;
}
        
Language Found: English
Bugbase Id: 192395
Needs Release Note: No
Triaged: Yes
Regression: No
QA Owner: Kishan Venkataramana
Resolved by: Mike Schiff
Fixed Version: SDK Moxie M3 (Beta 2) - 176281
Confirmed Version: SDK Moxie M3 (Beta 2) - 176281
Participants: Beta App, JIRA Migration Admin, Kishan Venkataramana and Mike Schiff


 All   Comments      Sort Order:
JIRA Migration Admin - [05/12/07 05:13 PM ]
Move from BugDB issue number 192395

JIRA Migration Admin - [05/12/07 05:13 PM ]
Milestone ID = 1612
Milestone = M3_Moxie
Build ID = 23637
Build = 154223_GMC - GMC 1
Fix Build ID = null
Fix Build = null

Mike Schiff - [07/10/07 06:29 PM ]
P4 changelist #176151.

I incorporated the suggested fix, which seemed good.

Kishan Venkataramana - [07/13/07 02:17 AM ]
Confirmed as fixed with build 176281.