I'm having problem doing Add/Remove rows dynamically.
I'm having a row which has list of dropdown and text boxes. This row is part of rich:datatable. At the end of the row, we provide an option to either add a similar row or delete the row. When user clicks on the Add button, in the
java code I'm just incrementing the counter and rerendering the rich:datatable again.
jsf code snippet..
<rich:dataTable value="#{coreService.dataList}" var="counter" id="list">
.....
<h:selectOneMenu value="#{coreService.selectName}" rerender="true">
<f:selectItems value="#{coreSerice.listOfNames}" />
</h:selectOneMenu>
<a4j:commandButton value="+" action="#{coreService.addARow}" reRender="list"/>
</rich:dataTable>
The problem is, when we submit the form and when we have mulitple rows, I'm not able to read all the selected dropdown values. It is getting overwritten and only the last dropdown value I'm able to capture in the backing bean. Can anyone provide some insight on how to solve this problem.