i was trying to print the value entered in the inputText but it only shows 0 except for the last row it shows the right value! here's a minimal code (i didn't include all the fields and the getters/setters)
@ManagedBean(name="medicament")
@ViewScoped
public class MedicamentBean {
private List<Medicament> medicaments;
private String libelle;
private int qte_vente;
public void test() {
System.out.println(this.qte_vente);
}
}
html:
<h:form>
<p:dataTable value ="#{medicament.medicaments}" var ="m">
<p:column headerText="libelle">
<h:outputText value = "#{m.libelle}"/>
</p:column>
<p:column headerText="qte">
<h:inputText value ="#{medicament.qte_vente}" onkeyup="myCommand();"/>
<p:remoteCommand name="myCommand" actionListener="#{medicament.test()}" style="display: none;"
/>
</p:column>
</p:dataTable>
</h:form>