javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-2536

UIInput#getValue() should consider isLocalValueSet() and return getLocalValue() instead of getValue()

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Background:
      http://stackoverflow.com/q/12838740/157882

      Use case:

      • A form with 2 non-required number input fields bound to Integer properties.
      • Fill in valid number values and submit form.
      • Remove the value from first field and enter an invalid value (with an alphabetic character, for example) in second field and submit form.

      Expected behavior:
      Form redisplays with exactly the submitted values in both fields.

      Actual behavior:
      Form redisplays with old model value in first field and submitted value in second field.

      Cause:
      UIInput#isLocalValueSet() is not considered in UIInput#getValue().

      Fix:
      Implement UIInput#getValue() accordingly.

      public Object getValue() {
          return isLocalValueSet() ? getLocalValue() : super.getValue();
      }
      

      Related issues:

      Note: MyFaces already does it right.

        Issue Links

          Activity

          Hide
          Manfred Riem added a comment -

          Linking to the SPEC issue that tracks this request.

          Show
          Manfred Riem added a comment - Linking to the SPEC issue that tracks this request.
          Hide
          Manfred Riem added a comment -

          Closing this as a duplicate since there is an associated spec issue that needs to be addressed for this. Note if MyFaces is already doing this in the 2.1 branch it might not be 2.1 spec compliant.

          Show
          Manfred Riem added a comment - Closing this as a duplicate since there is an associated spec issue that needs to be addressed for this. Note if MyFaces is already doing this in the 2.1 branch it might not be 2.1 spec compliant.
          Hide
          Ed Burns added a comment -

          I will be making updates on JAVASERVERFACES_SPEC_PUBLIC-566 on this so please observe that issue if you want to keep track of progress.

          Show
          Ed Burns added a comment - I will be making updates on JAVASERVERFACES_SPEC_PUBLIC-566 on this so please observe that issue if you want to keep track of progress.

            People

            • Assignee:
              Manfred Riem
              Reporter:
              balusc
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: