im having a problem where i have printed out Snowboards in a datatable from a ArrayList. The problem is happening when i have a button that will be sent to a method and for now just system out it. When the button is clicked i get all the ids from the arraylist instead of just the specific one.
index.xhtml
<h:dataTable value="#{snowboardBean.snowList}" var="list">
<h:column>
ID: #{list.id}<br></br>
Product Name: #{list.productName}<br></br>
Brand Name: #{list.brandName} <br></br>
<ui:param name="listID" value="#{list.id}" />
<h:button value="Test" onclick="#{snowboardBean.forwardId(listID)}" />
</h:column>
</h:dataTable>
ForwardId() in the bean
public void forwardId(String productId){
System.out.println("ForwardID");
this.productId = productId;
System.out.println(productId);
System.out.println(this.productId);
}
Output like this after one click: ForwardID 1 ForwardID 2