How to use in or to select multiple items?

Your best bet is to bind the <h:selectBooleanCheckbox> value with a Map<Item, Boolean> property where Item represents the object behind the corresponding row. <h:dataTable value=”#{bean.items}” var=”item”> <h:column> <h:selectBooleanCheckbox value=”#{bean.checked[item]}” /> </h:column> … </h:dataTable> <h:commandButton value=”submit” action=”#{bean.submit}” /> public class Bean { private Map<Item, Boolean> checked = new HashMap<Item, Boolean>(); private List<Item> items; public void submit() … Read more

Using on a List doesn’t update model values

The String class is immutable and doesn’t have a setter for the value. The getter is basically the Object#toString() method. You need to get/set the value directly on the List instead. You can do that by the list index which is available by <ui:repeat varStatus>. <ui:repeat value=”#{mrBean.stringList}” varStatus=”loop”> <h:inputText value=”#{mrBean.stringList[loop.index]}” /> </ui:repeat> You don’t need … Read more