I am try to select one item of the primefaces datalist. I am following primefaces web site as tutarial. http://www.primefaces.org/showcase/ui/datagrid.jsf (DataList has the same behavior as datagirid)
Here is my codes.
My bean :
@Component
@Scope("session")
public class HomeBean {
@Value("Aranacak kelime giriniz.")
private String keyword;
private List<Customer> customers;
private Customer selectedCustomer;
//Setter getters
}
My page :
<p:dataList value="#{homeBean.customers}" var="customer" >
<f:attribute name="filter" value="true" />
<p:commandLink>
#{customer.customerName}
<f:setPropertyActionListener value="#{customer}"
target="#{homeBean.selectedCustomer}" >
</f:setPropertyActionListener>
</p:commandLink>
</p:dataList>
the page shows proper values as list have. however, when i try to select one item. it does not work.
Any idea haw can i select a item in the list ?