Uploaded image for project: 'MyFaces Tomahawk'
  1. MyFaces Tomahawk
  2. TOMAHAWK-1219

validateEquals compares the wrong values

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1.5
    • 1.1.7
    • Validators
    • None

    Description

      The following scenario describes the occurrence of the bug:

      <h:inputSecret value="#

      {xxx.password}

      " id="username">
      <f:validateLength minimum="8" maximum="20"/>
      </h:inputSecret>

      <h:inputSecret value="" id="username2">
      <t:validateEqual for="username" />
      </h:inputSecret>

      If the user enters in the first input field a correct username (length between 8 and 20 characters), but not the same username in the second field, an errors occurs correctly. But if the user removes/adds characters in the first field to that effect that the length validator throws an exception (username < 8 character or username > 20 characters) but the values in both fields are equal, the validateEqual validator throws an exception too.

      I guess that the equal validator takes the wrong value of the first component by using the method getValue(), not getSubmittedValue(). getValue() returns the value which is in the component if no validators threw an exception. But in this case, the validateLength validator threw an exception and getValue returns the value that was submitted before (the valid username) not the actual (invalid) value.

      Attachments

        Activity

          People

            lu4242 Leonardo Uribe
            daniel.plappert Daniel Plappert
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: