[ 
https://issues.apache.org/jira/browse/TRINIDAD-2028?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Gabrielle Crawford resolved TRINIDAD-2028.
------------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.0-beta-3

> Should reset value on component at the beginning of decode
> ----------------------------------------------------------
>
>                 Key: TRINIDAD-2028
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2028
>             Project: MyFaces Trinidad
>          Issue Type: Bug
>          Components: Components
>    Affects Versions: 1.2.14-core 
>         Environment: Environment independent
>            Reporter: Jing Wu
>            Assignee: Gabrielle Crawford
>            Priority: Minor
>             Fix For: 2.0.0-beta-3
>
>         Attachments: resetvalue.patch
>
>
> 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.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to