I am working with Mojarra 2.1.3.
When the user clicks the “Update does not work” button, he updates the contents of the ui: repeat.I file, I expect the checkbox to be checked, just like during initialization.
What I found: if I remove h: the head in the face “update does not work” works ... Any idea?
Front side:
<h:head></h:head> <h:body> <h:form id="myForm" > <h:panelGroup id="panelToRefreshOutsideRepeat"> <ui:repeat value="#{sandbox.columns}" var="column"> <h:panelGroup id="panelToRefreshInsideRepeat"> <h2>composite onlyCheckbox:</h2> <trc:onlyCheckbox value="#{column.value}" /> <br /> <h2>composite onlyInputText:</h2> <trc:onlyInputText value="#{column.value}" /> <br /> <br/> <h:commandButton value="Refresh don't work" > <f:ajax render="panelToRefreshInsideRepeat" /> </h:commandButton> <h:commandButton value="Refresh work" > <f:ajax render=":myForm:panelToRefreshOutsideRepeat" /> </h:commandButton> </h:panelGroup> <br/> </ui:repeat> </h:panelGroup>
Composite for onlyCheckbox and onlyInputText:
<composite:interface> <composite:attribute name="value" type="boolean"/> </composite:interface> <composite:implementation> boolean: <h:selectBooleanCheckbox value="#{cc.attrs.value}" /> boolean value: #{cc.attrs.value} </composite:implementation>
and bean support:
@ManagedBean @RequestScoped public class Sandbox { public List<Column> columns = Arrays.asList(new Column(true)); public List<Column> getColumns() { return columns; } public void setColumns(List<Column> columns) { this.columns = columns; } public class Column { private boolean value; public Column(boolean value) { this.value = value; } public void setValue(boolean value) { this.value = value; } public boolean getValue() { return this.value; } } }
source share