Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-26571

errorString does not reset the validators

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Adobe Flex SDK 3.5 (Release)
    • None
    • mx: General
    • Affected OS(s): Windows
      Affected OS(s): Windows XP
      Browser: Firefox 3.x
      Language Found: English

    Description

      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.

      Attachments

        1. FLEX-26571.ZIP
          17 kB
          Piotr Zarzycki

        Activity

          People

            Unassigned Unassigned
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: