javaserverfaces-spec-public
  1. javaserverfaces-spec-public
  2. JAVASERVERFACES_SPEC_PUBLIC-566

UIOutput.getValue() should return the local value of the component if it has been set, even if null.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 2.2
    • Component/s: Lifecycle
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: Macintosh

    • Issuezilla Id:
      566
    • Status Whiteboard:
      Hide

      cat1 javadoc size_medium importance_medium

      Show
      cat1 javadoc size_medium importance_medium

      Description

      Consider:
      ---------------------------------------------
      for example:
      <h:form>
      <h:inputText id="input1" required="#

      {true}

      "/>
      <h:message for="input1"/>
      <h:inputText id="input2" value="#

      {testBean.value}

      ">
      <f:convertNumber integerOnly="true"/>
      </h:inputText>
      <h:message for="input2"/>
      <h:commandButton/>
      </h:form>

      public class TestBean {
      private String input1;
      private Integer input2 = 1;
      ...
      }

      from browser:
      1. Enter input1 empty text.
      2. Enter input2 empty text.
      3. submit.

      results:

      • A Required error for input1 is displayed.
      • The input2 text is "1".

      I hope:

      • A Required error for input1 is displayed.
      • The input2 text is empty text.

      ---------------------------------------------

        Issue Links

          Activity

          Ed Burns logged work - 20/Oct/12 6:50 AM
          • Time Spent:
            2 hours
             
            <No comment>
          Ed Burns logged work - 23/Oct/12 4:18 PM
          • Time Spent:
            4 hours, 31 minutes
             
            SECTION: Modified Files
            ----------------------------
            M jsf-api/src/main/java/javax/faces/component/UIInput.java

            - Add getValue() override, suggested by BalusC.

            - Modify resetValue() to use newly added UIOutput.resetValue().

            M jsf-api/src/main/java/javax/faces/component/UIOutput.java

            - Added resetValue(), necessary to make existing testcases run.

            M jsf-api/src/test/java/javax/faces/component/UISelectBooleanTestCase.java
            M jsf-api/src/test/java/javax/faces/component/UIInputTestCase.java
            M jsf-api/src/test/java/javax/faces/component/UIOutputTestCase.java
            M jsf-api/src/test/java/javax/faces/component/UISelectManyTestCase.java

            - Use resetValue() instead of setValue(null)

            A test/agnostic/lifecycle/basic/src/test/java/com/sun/faces/test/agnostic/lifeycle/basic/Spec566IT.java
            A test/agnostic/lifecycle/basic/src/main/java/com/sun/faces/test/lifecycle/basic/TestBean.java
            A test/agnostic/lifecycle/basic/src/main/webapp/spec566.xhtml

            - New test content

            D test/agnostic/lifecycle/basic/src/test/java/com/sun/faces/test/agnostic/lifeycle/basic/Issue533IT.java
            A + test/agnostic/lifecycle/basic/src/test/java/com/sun/faces/test/agnostic/lifeycle/basic/Spec533IT.java

            - Rename this to reflect it being a spec issue.
            Sending jsf-api/src/main/java/javax/faces/component/UIInput.java
            Sending jsf-api/src/main/java/javax/faces/component/UIOutput.java
            Sending jsf-api/src/test/java/javax/faces/component/UIInputTestCase.java
            Sending jsf-api/src/test/java/javax/faces/component/UIOutputTestCase.java
            Sending jsf-api/src/test/java/javax/faces/component/UISelectBooleanTestCase.java
            Sending jsf-api/src/test/java/javax/faces/component/UISelectManyTestCase.java
            Adding test/agnostic/lifecycle/basic/src/main/java/com/sun/faces/test/lifecycle/basic/TestBean.java
            Adding test/agnostic/lifecycle/basic/src/main/webapp/spec566.xhtml
            Deleting test/agnostic/lifecycle/basic/src/test/java/com/sun/faces/test/agnostic/lifeycle/basic/Issue533IT.java
            Adding test/agnostic/lifecycle/basic/src/test/java/com/sun/faces/test/agnostic/lifeycle/basic/Spec533IT.java
            Adding test/agnostic/lifecycle/basic/src/test/java/com/sun/faces/test/agnostic/lifeycle/basic/Spec566IT.java
            Transmitting file data ..........
            Committed revision 10898.

            People

            • Assignee:
              Ed Burns
              Reporter:
              Ryan Lubke
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 6 hours, 31 minutes
                6h 31m