Actually you can use a ValueChangeListener that is invoked when the value of your selectOneMenu changes:
Then, in your bean you have this method:
public void selectOneMenuListener(ValueChangeEvent event) {
//This will return you the newly selected
//value as an object. You'll have to cast it.
Object newValue = event.getNewValue();
//The rest of your processing logic goes here...
}
To update the page you can either add onchange="submit()"
to your
. For some partial rendering you can try adding this
instead of onchange="submit()"
:
If I'm not mistaken you'll want to get the id of the element selected in the first menu and populate the second one according to it. Then you can render the other selectOneMenu or, if needed, a panel wrapping a part of your form.