Hello i’ve got a probleme with the tag Selectonemenu i’ve used it but it does not return any value to the bean :: this is the syntaxe in the jsp :
<h:selectOneMenu id=”valeur” value=”#{projet.valeur}”>
<f:selectItems value=”#{projet.proref}” />
</h:selectOneMenu>
so the menu is well displayed but when i’m trying to display the property “valeur” it’s gives me null.
proref is a SelectItem array :
public SelectItem[] getProref() {
projet pr= new projet();
ResultSet rs = null;
String ww= new String();
int i=0;
int occ=0;
occ=Connexion.taille(table);
String requete = “Select * from projet”;
SelectItem[] tabpro= new SelectItem[occ];
try {
rs = Connexion.getcon().executeQuery(requete);
while (rs.next()) {
tabpro[i]= new SelectItem(new Integer(i+1),rs.getString(“nom”),rs.getString(“nom”));
i++;
}
} catch (SQLException e) {
e.printStackTrace();
}
return tabpro;
}
code for property valeur is :
public SelectItem getValeur(){
System.out.println(” Invocation get ::: “+ ++i +”:valeur ::”+ valeur );
return valeur;
}
public void setValeur(int key){
}
i’m really sick of that cause i’ve tried all solution : i’ve declared key as string selectitem and Integer but no way it seem’s the jsp page don’t give a value to the property projet.valeur
please help me by giving me a source or precise advise
thanx anyway !!!!! 😯 😕 😕 😯 🙄 😀