Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-1549

MyFaces-API issue: getValue of UIInput

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1.5
    • 1.1.6
    • JSR-127
    • None

    Description

      UIOutput currently has the following code:

      public Object getValue()

      { if (_value != null) return _value; ValueBinding vb = getValueBinding("value"); return vb != null ? (Object)vb.getValue(getFacesContext()) : null; }

      UIInput has the following code:

      public void setValue(Object value)

      { setLocalValueSet(true); super.setValue(value); }

      My problem (pseudo code):

      1) user enters an empty string in an input-component: ""
      2) conversion and validation phase: "" --> setValue(null);
      isLocalValueSet = true; setSubmittedValue(null);
      3) validation fails in some component on the page --> update model
      phase is skipped
      4) renderer calls getValue(); --> getValue() evaluates the
      value-binding, as the local-value is 'null', and I get the
      default-value of the bean shown again

      proposed solution:

      UIInput overwrites getValue of UIOutput:

      public Object getValue()

      { if (isLocalValueSet()) return _value; ValueBinding vb = getValueBinding("value"); return vb != null ? (Object)vb.getValue(getFacesContext()) : null; }

      Attachments

        Issue Links

          Activity

            People

              mmarinschek Martin Marinschek
              mmarinschek Martin Marinschek
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: