You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Martin Marinschek (JIRA)" <my...@incubator.apache.org> on 2005/05/24 23:27:09 UTC

[jira] Reopened: (MYFACES-187) UIInput.getValue can return wrong (old) value

     [ http://issues.apache.org/jira/browse/MYFACES-187?page=all ]
     
Martin Marinschek reopened MYFACES-187:
---------------------------------------

     Assign To: Martin Marinschek  (was: Grant Smith)

This is not the correct fix. There is a valid reason for this part of the code, and it is behaving very much as the reference implementation does.

In fact, an empty string can never be committed by an UIInput; this empty string is just a place holder which makes sure that validation on the component will happen.

we have had a lengthy discussion about that on the mailing-list.

Whatever your problem was, removing that code is not the correct solution. Please resubmit your problem with more thorough information...

> UIInput.getValue can return wrong (old) value
> ---------------------------------------------
>
>          Key: MYFACES-187
>          URL: http://issues.apache.org/jira/browse/MYFACES-187
>      Project: MyFaces
>         Type: Bug
>     Versions: 1.0.9 beta
>     Reporter: Howard Abrams
>     Assignee: Martin Marinschek
>      Fix For: Nightly Build

>
> 'UIInput.getValue' will return the wrong (old) value if called between validation and update phase when the submitted value is "" and the old value was a non-zero length string.
> The offending code is in UIInput.validate:
>     if(submittedValue instanceof String && ((String) submittedValue).length()==0)
>     {
>         submittedValue = null;
>     }
> The effect of this is that when the client submits "", the submittedValue of null works it's way down to 'setValue'. This would seem correct, but 'getValue' checks to see if the value is null, and if it is, it uses the value binding. The end result is that 'getValue' will return the wrong (old) value if called between validation and update phase becuase the model has not been updated yet, but the local value has been null'd.
> Neither the spec, nor the offical JavaDoc mention this behavior. I belive the code should be removed. Anyone know why it is there?

-- 
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