uirepeat

Using <ui:repeat><h:inputText> on a List<String> doesn&#39;t update model values

和自甴很熟 提交于 2019-11-25 22:49:51
Here is the scenario (simplified): There is a bean (call it mrBean ) with a member and the appropriate getters/setters: private List<String> rootContext; public void addContextItem() { rootContext.add(""); } The JSF code: <h:form id="a_form"> <ui:repeat value="#{mrBean.stringList}" var="stringItem"> <h:inputText value="#{stringItem}" /> </ui:repeat> <h:commandButton value="Add" action="#{mrBean.addContextItem}"> <f:ajax render="@form" execute="@form"></f:ajax> </h:commandButton> </h:form> The problem is, when clicking the "Add" button, the values that were entered in the <h:inputText/> that