ui:repeat does not repeat the components in the root of the view; it repeats the output of the component in the HTML output.
There are several ways to achieve this. One of them is to use the value object instead and set the required value. For instance. a List<Item> , where Item has the String name and boolean required properties.
<ui:repeat value="#{test.items}" var="item" id="repeat"> <h:panelGrid columns="3"> <h:outputLabel id="nameLabel">name:</h:outputLabel> <h:inputText id="name" value="#{item.name}" required="#{item.required}" validator="#{test.validateName}" /> <h:message for="name"></h:message> </h:panelGrid> </ui:repeat>
There are more ways, but since the version of JSF you are using and the functional requirements are unclear, it only guesses which path is most applicable in your case.
source share