I'm trying to collect values of an UIInput
component inside an UIData
component during bean's action method in order to validate duplicate values. I tried to bind the UIInput
component to a bean property and getting its value, but it prints null
. If I place it outside the datatable, then it prints the expected value. Is there something wrong with the datatable?
<rich:dataTable binding="#{bean.table}" value="#{bean.data}" var="item">
<h:column>
<f:facet name="header">
<h:outputText value="Field1" />
</f:facet>
<h:inputText binding="#{bean.input}" value="#{item.field1}" />
</h:column>
</rich:dataTable>
Here's the backing bean code:
private UIData table;
private UIInput input;
public void save() {
System.out.println(input.getId() + " - " + input.getValue());
}