I am using IceFaces components and I am trying to fill up a select with some values that correspond to a MangedBean property.
<h:form>
<ice:selectOneMenu size="1" style="width: 180px">
<f:selectItem value="#{stockManagedBean.listeCategoriesItem}"></f:selectItem>
</ice:selectOneMenu>
</h:form>
listeCategoriesItem is a property of StockManagedBean and is an ArrayList of SelectItem.
@ManagedBean
public class StockManagedBean {
CategorieDAO categorieDAO;
List<SelectItem> listeCategoriesItem;
public StockManagedBean() {
categorieDAO = new CategorieDAO();
listeCategoriesItem = new ArrayList<SelectItem>();
List<Categorie> listeCategories = categorieDAO.selectAllCat();
for(Categorie categorie: listeCategories) {
listeCategoriesItem.add(new SelectItem(categorie.getCatId(), categorie.getCatNom()));
}
}
public List<SelectItem> getListeCategoriesItem() {
return listeCategoriesItem;
}
public void setListeCategoriesItem(List<SelectItem> listeCategoriesItem) {
this.listeCategoriesItem = listeCategoriesItem;
}
}
I tested the values that come from my DAO and they are all correct. I also tested the values of the list in the getter and they are also correct, but when I load my html page, nothing is in the select list...