I'm making a datatable where you can add exrta rows. In this extra rows, there's a inputtext. After putting something in the inputtext, this value should be saved to a list. But it's not. I tried in the method below using Sting as a parameter, but then to a list was saved : "javax.faces.component.html.HtmlInputText@23sdf
" and thing like that. When I changed method to javax.faces.component.html.HtmlInputText method below returns null.
here's code of table:
<h:dataTable value="#{correct.newPowody}" var="z" binding="#{table}" >
<h:inputText binding="#{custom}" value="#{z}">
<f:ajax event="blur" listener="#{correct.newPowodyAdder(table.rowIndex, custom)}"
execute="@this" render="@form"/>
</h:inputText>
</h:dataTable>
here is my correct bean code:
public void newPowodyAdder(int rowIndex, javax.faces.component.html.HtmlInputText powod) {
String value = powod.getValue().toString();
this.newPowody.set(rowIndex, value);
}
}
this method just should add data from inputtext into a list. Thank you for help