You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flex.apache.org by "Piotr Zarzycki (JIRA)" <ji...@apache.org> on 2013/12/20 09:34:08 UTC

[jira] [Updated] (FLEX-26571) errorString does not reset the validators

     [ https://issues.apache.org/jira/browse/FLEX-26571?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Piotr Zarzycki updated FLEX-26571:
----------------------------------

    Attachment: FLEX-26571.ZIP

Hi,

Unable to reproduce. 
Environment:
Apache Flex 4.11
Firefox

Attached sample application. (zip, Intellij IDEA project)
Piotr

> errorString does not reset the validators
> -----------------------------------------
>
>                 Key: FLEX-26571
>                 URL: https://issues.apache.org/jira/browse/FLEX-26571
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: mx: General
>    Affects Versions: Adobe Flex SDK 3.5 (Release)
>         Environment: Affected OS(s): Windows
> Affected OS(s): Windows XP
> Browser: Firefox 3.x
> Language Found: English
>            Reporter: Adobe JIRA
>              Labels: easyfix, easytest
>         Attachments: FLEX-26571.ZIP
>
>
> Steps to reproduce:
> with this kind of validation:
> <mx:TextInput id="tovalidate" />
> <mx:Validator
> 		id="myValidator" 
> 		source="{tovalidate}" 
> 		required="true" 
> 		property="text"
> 		requiredFieldError="Field Required"/>
> <mx:Button label="clean errorStrings" click="tovalidate.errorString=''"/>
> 1. the TextInput is empty, hit tab to get out of it. valueCommit is properly fired. The
> validator run and the error show up.
> 2. hit the button, the error is removed. everything seems ok.
> 3. go back to the button, hit tab again, valueCommit is fired, the validator run
> but the error DOES NOT SHOW UP.
>  Expected Results:
>  
> the error should show up again
>  
>  Workaround (if any):
> do not use errorString, fire ValidationResultEvent programmatically like this:
> var evt:ValidationResultEvent = new ValidationResultEvent(ValidationResultEvent.VALID);
> myValidator.dispatchEvent(evt);
> the bug seems located in validationResultHandler in UIComponent.as
> in this test:
> if (msg && validatorIndex != -1 && errorArray[validatorIndex] != msg)
> using only errorString, we have still errorArray[validatorIndex] == msg, 
> the errorArray is not cleaned up, so we do not enter in the following line:
> dispatchEvent(new FlexEvent(FlexEvent.INVALID));
> so the TextInput does not show up the error.



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)