You can use the valueChangeListener
attribute, pointing to a method in the managed-bean and add a submit()
in the onchange
attribute.
The form should look like :
<h:form>
<h:selectOneMenu valueChangeListener="#{bean.valueChanged}"
onchange="submit()">
<f:selectItem itemValue="1" itemLabel="First" />
<f:selectItem itemValue="2" itemLabel="Second" />
</h:selectOneMenu>
</h:form>
And the valueChangeListener
method in the managed bean would be:
public void valueChanged(ValueChangeEvent event) {
//do your stuff
}