EqualValidator: Wrong Message when foreignComp.getValue()==null
---------------------------------------------------------------

         Key: MYFACES-242
         URL: http://issues.apache.org/jira/browse/MYFACES-242
     Project: MyFaces
        Type: Bug
    Versions: 1.0.9 beta    
    Reporter: Christian Daszenies


consider the following structure: there are two input-fields which are both 
required and their value shold be equal to each other
example:
<x:input id="msisdn" value="#{...msisdn}" required="true"/>
<x:message for="msisdn" />
<x:input id="msisdnConfirm" required="true">
<x:validateEqual for="msisdn"/>         
<x:message for="msisdnConfirm" />

if msisdn is not filled in one gets the following message
  message for="msisdn": Value is required
  message for="msisdnConfirm": The given value (xxx) is not equal with value of 
"msisdn".

Suggested behaviour:
The message for msisdnConfirm should not be displayed if the value for msisdn 
is not entered


                if(foreignComp==null)
                        throw new FacesException("Unable to find component '" + 
_for + "' (calling findComponent on component '" + uiComponent.getId() + "')");

+               if (foreignComp.isRequired() && foreignComp.getValue()== null ) 
{
+                       return;
+               }
                
                Object[] args = 
{value.toString(),(foreignComp.getValue()==null) ? 
foreignComp.getId():foreignComp.getValue().toString()};


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to