0 Replies Latest reply on Jul 17, 2009 9:08 AM by Joe Maglio

    rich:message for each h:inputText in a forEach loop

    Joe Maglio Newbie

      Hi

      How can I attach a rich:message to each inputText in a for loop without being able to dynamically generate the inputText id? if I add a static id, I get a duplicate id error. The problem with not using an 'id' on the input and a 'for' on the messsage, is that the error message appears for every other similar field on the form.
      I have multiple fields like this one:

      <c:forEach var="reference" varStatus="status" items="#{accounts}">
      <h:inputText value="#{reference.value}" >
      <rich:messages />
      <f:validateLength minimum="5" maximum="16" />
      <mj:regexValidator pattern="[0-9a-zA-Z]+" />
      </h:inputText>
      </c:forEach>

      Thanks
      Joe