I am using a JSF framework for my web app with Facelets(.xhtml) as the view.
I have a form which gets rendered using ui:repeat tag of facelets(database returns multiple rows which I iterate through the ui:repeat and display the data along with text fields for using to enter some data pertaining to the data returned from the database for each row).
The form contains checkboxex and some input fields, now the rows are rendered correctly but the problem I am facing is am not able to pass on the data entered by user to the backing bean.
When I try to submit the form (my submit button is outside ui:repear because I want all user data entered to be submitted as a single form) only first row of the ui:repeat is passed to the backing bean.
My question is that is there a way by which I can submit all the values within a form rendered using ui:repeat tag of facelets.
<table>
<tr>
<td>
<h:form>
<ui:repeat value="#{BeanName}" var="var">
<tr>
<td>
<h:selectBooleanCheckbox id="someId" binding="#{var.chkMaleFemale}">
</h:selectBooleanCheckbox>
<h:outputText id="someTextId" value="#{var.field1}">
</h:outputText>
</td>
</tr>
</ui:repeat>
<h:commandButton type="submit" value="Submit Selection" id="buttonSelect" action="#{BeanName.submit}">
</h:commandButton>
</h:form>
</td>
</tr>
</table>
In the backing bean named 'BeanName' I have a method named submit() but I am not able to figure out how do I get the checkBox status for as many number of rows returned from the ui:repeat.