commandButton method binding problem
Hello,
I have a problem that I have managed to isolate in the following code. The method Bean.submit which is bound as an action to a commandButton does not get executed:
Java:
publicclass Bean{
public Bean(){
}
public String submit(){
return"Hello";
}
privateint selection;
publicint getSelection(){
return selection;
}
publicvoid setSelection(int selection){
this.selection = selection;
}
}
JSP:
<h:selectOneMenu id="menu" value="#{bean.selection}">
<f:selectItem itemValue="0" itemLabel="0" />
<f:selectItem itemValue="1" itemLabel="1" />
</h:selectOneMenu>
<h:commandButton id="button" value="Submit" action="#{bean.submit}" />
However, if I remove the binding of the selectOneMenu, Bean.submit does get executed:
<h:selectOneMenu id="menu" >
<f:selectItem itemValue="0" itemLabel="0" />
<f:selectItem itemValue="1" itemLabel="1" />
</h:selectOneMenu>
<h:commandButton id="button" value="Submit" action="#{bean.submit}" />
Any thoughts? Appreciate your help.

