You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Mark Yvanovich (JIRA)" <de...@myfaces.apache.org> on 2011/03/17 00:54:29 UTC

[jira] Created: (TRINIDAD-2064) UIXEditableValue.compareValues() shouldn't return false for 'empty' strings of different lengths

UIXEditableValue.compareValues() shouldn't return false for 'empty' strings of different lengths
------------------------------------------------------------------------------------------------

                 Key: TRINIDAD-2064
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2064
             Project: MyFaces Trinidad
          Issue Type: Bug
          Components: Components
    Affects Versions: 2.0.0-beta-2
         Environment: Any
            Reporter: Mark Yvanovich
            Priority: Minor


In UIXEditableValue.validate(), UIXEditableValue.compareValues() is called to check to see if the value has changed.  Currently, if the previous value and the new value are both empty (i.e. whitespace) compareValues() returns false to indicate they are the same.  This, however, is not really correct.  If you enter the value " " (one space) and then later try to change it to "  " (two spaces) or "" (no spaces), the new value will be ignored because compareValues() says that the two values are the same.

This can be reproduced on the inputText tag demo page.  Select the contents of the inputText and type in a " " (one space) to replace the current value and hit submit.  Then, try to update the value to "  " (two spaces).  If you look at the value attribute in the table below with firebug, you'll see that the value doesn't get updated.  When using an inputText as a filter field, filtering by " " (one space) or "  " (two spaces) can have different results.  For this reason, we should allow for the value to be changed.

Basically, the logic should be that if the two values are empty (I.E. UIXEditableValue.isEmpty() returns true for both values) then we should check the lengths to see if they are in fact different.  The one condition that we need to preserve is that null and "" (no spaces, the real empty string) should compare as the same (so compareValues() should return false for this case).

The current work around is that you have to submit a non-empty value and then submit the desired new empty value (i.e. two spaces or no spaces, etc).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (TRINIDAD-2064) UIXEditableValue.compareValues() shouldn't return false for 'empty' strings of different lengths

Posted by "Mark Yvanovich (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TRINIDAD-2064?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Yvanovich updated TRINIDAD-2064:
-------------------------------------

    Status: Patch Available  (was: Open)

> UIXEditableValue.compareValues() shouldn't return false for 'empty' strings of different lengths
> ------------------------------------------------------------------------------------------------
>
>                 Key: TRINIDAD-2064
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2064
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 2.0.0-beta-2
>         Environment: Any
>            Reporter: Mark Yvanovich
>            Priority: Minor
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> In UIXEditableValue.validate(), UIXEditableValue.compareValues() is called to check to see if the value has changed.  Currently, if the previous value and the new value are both empty (i.e. whitespace) compareValues() returns false to indicate they are the same.  This, however, is not really correct.  If you enter the value " " (one space) and then later try to change it to "  " (two spaces) or "" (no spaces), the new value will be ignored because compareValues() says that the two values are the same.
> This can be reproduced on the inputText tag demo page.  Select the contents of the inputText and type in a " " (one space) to replace the current value and hit submit.  Then, try to update the value to "  " (two spaces).  If you look at the value attribute in the table below with firebug, you'll see that the value doesn't get updated.  When using an inputText as a filter field, filtering by " " (one space) or "  " (two spaces) can have different results.  For this reason, we should allow for the value to be changed.
> Basically, the logic should be that if the two values are empty (I.E. UIXEditableValue.isEmpty() returns true for both values) then we should check the lengths to see if they are in fact different.  The one condition that we need to preserve is that null and "" (no spaces, the real empty string) should compare as the same (so compareValues() should return false for this case).
> The current work around is that you have to submit a non-empty value and then submit the desired new empty value (i.e. two spaces or no spaces, etc).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (TRINIDAD-2064) UIXEditableValue.compareValues() shouldn't return false for 'empty' strings of different lengths

Posted by "Gabrielle Crawford (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TRINIDAD-2064?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gabrielle Crawford updated TRINIDAD-2064:
-----------------------------------------

    Resolution: Fixed
      Assignee: Gabrielle Crawford
        Status: Resolved  (was: Patch Available)

> UIXEditableValue.compareValues() shouldn't return false for 'empty' strings of different lengths
> ------------------------------------------------------------------------------------------------
>
>                 Key: TRINIDAD-2064
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2064
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 2.0.0-beta-2
>         Environment: Any
>            Reporter: Mark Yvanovich
>            Assignee: Gabrielle Crawford
>            Priority: Minor
>         Attachments: jira2064.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> In UIXEditableValue.validate(), UIXEditableValue.compareValues() is called to check to see if the value has changed.  Currently, if the previous value and the new value are both empty (i.e. whitespace) compareValues() returns false to indicate they are the same.  This, however, is not really correct.  If you enter the value " " (one space) and then later try to change it to "  " (two spaces) or "" (no spaces), the new value will be ignored because compareValues() says that the two values are the same.
> This can be reproduced on the inputText tag demo page.  Select the contents of the inputText and type in a " " (one space) to replace the current value and hit submit.  Then, try to update the value to "  " (two spaces).  If you look at the value attribute in the table below with firebug, you'll see that the value doesn't get updated.  When using an inputText as a filter field, filtering by " " (one space) or "  " (two spaces) can have different results.  For this reason, we should allow for the value to be changed.
> Basically, the logic should be that if the two values are empty (I.E. UIXEditableValue.isEmpty() returns true for both values) then we should check the lengths to see if they are in fact different.  The one condition that we need to preserve is that null and "" (no spaces, the real empty string) should compare as the same (so compareValues() should return false for this case).
> The current work around is that you have to submit a non-empty value and then submit the desired new empty value (i.e. two spaces or no spaces, etc).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira