Uploaded image for project: 'MyFaces Trinidad'
  1. MyFaces Trinidad
  2. TRINIDAD-2028

Should reset value on component at the beginning of decode

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.2.14-core
    • 1.2.15-core , 2.0.0-core
    • Components
    • None
    • Environment independent

    Description

      At the beginning of decode, we should reset the value on components, so that the states from previous request will not impact the current request.

      An example of wrong behavior caused by no reseting value is:

      1. suppose a component has value v1
      2. a request comes in, to update the component to a new value v2
      3. v2 passed conversation / validation, thus it is considered valid, VALID property is set to true. Since v2 is different from v1, thus a ValueChangeEvent is queued, and VALUE property is set to v2, LOCAL_VALUE_SET is set to true.
      4. v2 is pushed to model, but an exception occurs, VALID property is reset to false.
      5. a new request comes in, to update the component to value v1
      6. v1 is valid, thus VALID is set to true. The old value of the component is v1 (since we failed to push v2 to model), since new value v1 is the same as old value v1, thus no ValueChangeEvent is queued, and VALUE property remains v2
      7. in update_model phase, since both VALID and LOCAL_VALUE_SET is true, we go ahead with pushing local value to model. The local value (i.e. VALUE property of the component) is v2, so we try to push v2 to model, which will fail again.

      If we reset value on the component at the beginning of processDecode, this problem will not exist. Currently, we only reset VALID property in processDecode, we should reset all the properties.

      Attachments

        1. resetvalue-1.2.x.patch
          1 kB
          Jing Wu
        2. resetvalue.patch
          1 kB
          Jing Wu

        Activity

          People

            gabrielle Gabrielle Crawford
            jingwu Jing Wu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: