Migration combobox t:selectItems en f:selectItems
Bonjour,
Pour les besoins de mon application, je dois abandonner tomahawk.
J'ai donc l'obligation de faire migrer mes combo box e utilisant que les tags f:, cependant je n'arrive pas à obtenir de résultat probant à l'affichage je n'obtient que le chemin des objets (xx.xx.xx.ProduitStock@1b47cc2) et non les champs id et libelle.
Voici l'ancienne combo box jsf
Code:
1 2 3 4 5
| <rich:comboBox value="#{fournisseurListBean.filtre.produit}">
<f:selectItem itemValue=" "/>
<t:selectItems value="#{produitStockBean.list}" var="bean" itemValue="#{bean.libelle}"/>
<a4j:support event="onkeyup" action="#{fournisseurListBean.Load}" reRender="simpledata"></a4j:support>
</rich:comboBox> |
Voici la nouvelle :
Code:
1 2 3 4 5
|
<rich:comboBox value="#{fournisseurListBean.filtre.produit}">
<f:selectItems value="#{produitStockBean.list}" var="bean" itemValue="#{bean.id}" itemLabel="#{bean.libelle}"/>
<a4j:support event="onkeyup" action="#{fournisseurListBean.Load}" reRender="simpledata"></a4j:support>
</rich:comboBox> |
Ma fonction de list bean:
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
public Collection<SelectItem> getList() {
if (liste == null) {
liste = new ArrayList<SelectItem>();
for (ProduitStock produit : produitStockService.list()) {
liste.add(new SelectItem(produit));
}
}
return liste;
} |
Quelqu'un aurait il une petite idée ?
Par avance merci !