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

Bill Lucy commented on MYFACES-4318:
------------------------------------

[~volosied] I don't think we should bother with checking the state saving 
method here - as I understand the flow here (and like you said) the swap should 
work all cases.

[~tandraschko] I agree I'm not completely happy with this patch, but so far 
I've struggled to come up with something more generic.  The legacy TagHandler 
for this - LegacyForEachHandler - is a lot simpler, and closer to what Mojarra 
does in its default ForEach implementation.  The LegacyForEachHandler doesn't 
keep track of the iteration state as closely as ForEachHandler does (and that's 
what causes the behavior/problem I've reported here.)  [~lu4242] hinted at the 
complexity of keeping track of all of this state in MYFACES-3811.

> c:forEach problem with client side state saving
> -----------------------------------------------
>
>                 Key: MYFACES-4318
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4318
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 2.2.12, 2.3.6
>            Reporter: Bill Lucy
>            Priority: Major
>         Attachments: jsf_foreach_client_state.war, 
> jsf_foreach_client_state_mvn.zip
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> There appears to be a problem with c:forEach when client side state saving is 
> enabled -  component states are not restored correctly after a submit.  For 
> example, the text entered into this inputText is lost:
> {{{color:#800000}<c:forEach{color} 
> {color:#ff0000}var{color}{color:#000000}={color}{color:#0000ff}"current"{color}
>  
> {color:#ff0000}items{color}{color:#000000}={color}{color:#0000ff}"#\{list.items}"{color}{color:#800000}>{color}}}
> {{{color:#800000}<h:inputText{color} 
> {color:#ff0000}value{color}{color:#000000}={color}{color:#0000ff}"#\{current.value}"{color}{color:#800000}/>{color}}}
> {{{color:#800000}<h:commandButton{color} 
> {color:#ff0000}value{color}{color:#000000}={color}{color:#0000ff}"submit"{color}{color:#800000}/>{color}}}
> {{{color:#800000}</c:forEach>{color}}}
>  
> This example works (the inputText is not lost) with server side state saving 
> enabled, and it also works on Mojarra with client side state saving. I 
> haven't figured out what exactly is causing this behavior yet - if anyone 
> else has insight in this area I'd appreciate hints.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to