MyFaces Core
  1. MyFaces Core
  2. MYFACES-1160

Null Value for Attribute_value in UIInput can have two different meanings

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: General
    • Labels:
      None

      Description

      1. no value is set to this component
      2. An submitted value is empty ("").
      In both cases the getValue() Method will result the valueBinding

      Problem:
      If any validation error occurs on the page, the submitted empty value will be replaced by the valueBinding and can be <> ""

      Any workarounds ??

      regards,

      Andreas

      ----- I will close the ticket MYFACES-1056: It's the same background -------

        Activity

        Hide
        Andreas Knuth added a comment -

        A possible workaroud could be:

        You already have a Flag called _localValueSet:

        Probably use this Flag and override the getValues() and setValue() Method in UIInput:

         
        public Object getValue() {
            if (isLocalValueSet()){
                return theValue;
            }
            return super.getValue();
        }
        
         
        public void setValue(Object value) {
            theValue = value;
            super.setValue(value);
        }
        

        where theValue is a member variable of UIInput and will be saved by the StateManager

        Show
        Andreas Knuth added a comment - A possible workaroud could be: You already have a Flag called _localValueSet: Probably use this Flag and override the getValues() and setValue() Method in UIInput: public Object getValue() { if (isLocalValueSet()){ return theValue; } return super .getValue(); } public void setValue( Object value) { theValue = value; super .setValue(value); } where theValue is a member variable of UIInput and will be saved by the StateManager
        Hide
        Andreas Knuth added a comment -

        Sorry, Text formatting in Jira is not supported before V 3.4

        Show
        Andreas Knuth added a comment - Sorry, Text formatting in Jira is not supported before V 3.4

          People

          • Assignee:
            Unassigned
            Reporter:
            Andreas Knuth
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development