I\'m trying to display a Hashmap in a DataTable, here\'s what i\'m trying to do : I\'ll have a select menu of some products, and an input text for quantity, an \"ajaxified\"
You create Class like this:
public class Product{
private int id;
private String productName;
private int quantitiy;
// add getters setters here
}
// add product id to map key
Map myMap = new HashMap();
public Map getProductMap() {
return myMap;
}
public List getProducts() {
return new ArrayList(myMap.values()_;
}
Add datatable value to getProducts() List
Otherwise, product as a map key then,
Map myMap = new HashMap();
public List> getProducts() {
Set> productSet =
myMap.entrySet();
return new ArrayList>(productSet);
}
write primeface page like this way,