[ 
https://issues.apache.org/jira/browse/MYFACES-4029?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15146226#comment-15146226
 ] 

Leonardo Uribe commented on MYFACES-4029:
-----------------------------------------

I have reviewed the example and the conclusion is there is no bug here.

c:forEach is a "build view" time tag and ui:repeat is a "render view" time tag. 
That means the iteration of c:forEach is done at build view time and in that 
way it is "decoupled" from the model to keep the view structure stable. 
c:forEach use serialization to store the BooleanValueContainer into the view 
state to later use it. The result is you have two instances instead of one and 
the change of state is applied to the instance stored in the view state, not to 
the one in the model. 

In ui:repeat case, there is no copy and the instance is always fetch from the 
model, which is the reason why it works correctly. But the behavior of 
c:forEach is also correct, because this is an special tag used to alter the way 
how the component tree is built. When c:forEach is used, a real component tree 
is created per row, but on ui:repeat case the same component instance is used 
across rows. 

Since there is no bug, I'll close it as invalid. Thanks for provide the 
example, it helps a lot.

> Updating a value within c:forEach not possible when using MyFaces and Spring 
> Webflow
> ------------------------------------------------------------------------------------
>
>                 Key: MYFACES-4029
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4029
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 2.2.9
>            Reporter: Johannes Grimm
>         Attachments: faces-webflow-repeater-test.zip
>
>
> In a Spring Webflow project that uses MyFaces as view technology the update 
> of MyFaces from 2.1.17 to 2.2.9 breaks the update of a bound value within a 
> c:forEach tag.
> A complete example will be provided as attachment.
> Steps to reproduce the error:
> # Ensure the selected {{myfaces.version}} in the {{pom.xml}} is *2.2.9*
> # Start the application and open the respective website
> # Select _c:forEach (non-ajax)_
> # Activate the checkbox
> # Click _Apply_
> The value should change from _false_ to _true_ (or vice versa if it was 
> _true_ before) but nothing happens.
> The ajaxified c:forEach example doesn't work either. Only the ui:repeat 
> version works as expected.
> With _MyFaces 2.1.17_ all examples work as expected.
> I thought this might be a duplicate of MYFACES-4019 but that ticket has been 
> fixed for _MyFaces 2.2.9_ whereas the problem described above is still 
> present even with version _2.2.9_.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to