You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Daniel Plappert (JIRA)" <de...@myfaces.apache.org> on 2008/03/28 11:46:24 UTC

[jira] Created: (TOMAHAWK-1219) validateEquals compares the wrong values

validateEquals compares the wrong values
----------------------------------------

                 Key: TOMAHAWK-1219
                 URL: https://issues.apache.org/jira/browse/TOMAHAWK-1219
             Project: MyFaces Tomahawk
          Issue Type: Bug
          Components: Validators
    Affects Versions: 1.1.5
            Reporter: Daniel Plappert


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. 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.