You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Josh Davis (JIRA)" <de...@myfaces.apache.org> on 2015/07/21 20:22:06 UTC

[jira] [Created] (MYFACES-4007) HtmlSelectOneMenu using previous value when setting the dropdown to the empty select item

Josh Davis created MYFACES-4007:
-----------------------------------

             Summary: HtmlSelectOneMenu using previous value when setting the dropdown to the empty select item
                 Key: MYFACES-4007
                 URL: https://issues.apache.org/jira/browse/MYFACES-4007
             Project: MyFaces Core
          Issue Type: Bug
    Affects Versions: 2.1.16
            Reporter: Josh Davis


The issue occurs when using either #{null} or the empty string in a selectItem for the selectOneMenu control.  If you then save a value for the selectOneMenu and choose to edit it again and change the value to the empty selection item the original value is used rather than the empty submitted one.  We are currently using the property that treats the empty string as null so it makes sense that both behave the same.  Using " " instead of the empty string allows the save to work properly but then we have to deal with this hack in our whole code base.

My thought (not having in depth knowledge of the myfaces source) is that the issue is in the HtmlRenderUtils.java class starting on line 457.  It first checks the the submittedValue which is null and then the next check is that if the value is null it then calls the components getValue() method which returns the old value.  Is this the intended behavior for a null value and if so what should we be doing for empty selectItems?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)