We have a requirement of repeating a set of form elements based on a dynamic count. For this reason we have used the af:iterator component. Additionally the requirement is also to perform validations in all the fields.
The issue is, the required validations are happening, but then the message is not getting displayed beneath the component. However when we change the globalOnly attribute to true, then the validations appear correctly at the top, but against component
We have a feeling that the message component is not able to associate itself with the input text component, considering the ids assigned by the iterator are dynamic in nature. However we may be wrong here.
Request some one to suggest a solution, as this is a very important requirement for us.
the component ID "it2" doesn't appear on the printed output. Iterator content are stamped and as such a cell in a row is not a component (and if it was a component then not all would have the input text Id set to it2). In your case af:forEach will work if you make sure the input text ID and the message ID are dynamically generated to be unique
Thanks for the response. But I am not clear as to how we can use the af:forEach in this case. Reason being, we need to display the ViewObject values. And the view object will be populated on load of the screen. Can you please share a code snippet. Would be helpful.