Johannes Grimm created MYFACES-4019:
---------------------------------------

             Summary: Updating a bound value not possible if input component is 
within c:forEach
                 Key: MYFACES-4019
                 URL: https://issues.apache.org/jira/browse/MYFACES-4019
             Project: MyFaces Core
          Issue Type: Bug
    Affects Versions: 2.2.8
            Reporter: Johannes Grimm


Updating a value is not possible if the respective input component is within a 
c:forEach tag.

The server shows a {{javax.el.PropertyNotFoundException}}.

*Example:*

{code:title=View}
<h:form>
        <c:forEach items="#{controller.containers}" var="container" 
varStatus="status">
                <div>
                        <h:selectBooleanCheckbox id="checked_#{status.index}" 
value="#{container.checked}" />
                                                        
                        <h:panelGroup id="infotext_#{status.index}">
                                container.checked = #{container.checked}
                        </h:panelGroup>
                </div>
        </c:forEach>
        <h:commandButton value="Apply" />
</h:form>
{code}

{code:title=Controller.java}
public class Controller {
        public static final class Container implements Serializable {
                private boolean checked = false;
                
                public final boolean isChecked() { return checked; }
                public final void setChecked(boolean checked) { this.checked = 
checked; }
        }
        
        private final List<Container> containers = Arrays.asList(new 
Container());
        
        public List<BooleanValueContainer> getContainers() { return containers; 
}
}
{code}

A complete example can be found here: 
[https://github.com/jgrimmwsb/faces-repeater-test].

Steps to reproduce the error:

# Ensure the selected {{myfaces.version}} in the {{pom.xml}} is *2.2.8*.
# Start the application and open the respective website.
# Select _c:forEach (non-ajax)_.
# Activate the checkbox.
# Click _Apply_.

With _MyFaces 2.2.7_ the error did not occur.

The project contains further examples:

* An c:forEach example including an ajaxified version (working with _MyFaces 
2.2.7_)
* An ui:repeat (ajaxified) example (working with _MyFaces 2.2.8_)



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

Reply via email to