I spend the whole day trying to find a solution.
I have a rather common case...a dataTable with input fields
and a button to add a new row.
What happens is that the row is added, but the text in the
input field is empty. How can I keep the value?
<a4j:region>
<rich:dataTable var="data" value="#{invoice.itemList}"
id="itemTable"
rowKeyVar="rowIndex" binding="#{invoice.dataTable}">
<f:facet name="header">
<h:outputText value="#{msg.invoiceItem_table_header}" />
</f:facet>
<rich:column width="18px" sortable="false">
<f:facet name="header">
<rich:spacer />
</f:facet>
<a4j:commandButton id="delete" actionListener="#{invoice.deleteLine}"
image="/app/images/delete.gif" alt="#{msg.global_button_alt_delete}"
reRender="itemTable" immediate="true" rendered="#{rowIndex > 0}"
ajaxSingle="false" >
<f:param id="rowIndexDeleteId" name="rowIndex" value="#{rowIndex}" />
</a4j:commandButton>
<rich:spacer />
</rich:column>
<rich:column>
<f:facet name="header">
<h:outputText value="#{msg.invoiceItem_text}" />
</f:facet>
<h:inputTextarea value="#{data.text}"
binding="#{invoice.inputText}">
</h:inputTextarea>
</rich:column>
</rich:dataTable>
</a4j:region>