Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
2.2.8
-
None
-
None
Description
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:
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>
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; } }
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)
Attachments
Issue Links
- duplicates
-
MYFACES-3980 c:forEach varStatus is assigned with the wrong base
- Closed