I've a p:selectOneMenu component within a h:form component like:
<p:selectOneMenu id="scroll" rendered="#{projectPageBean.rendered}"
value="#{projectPageBean.selectedInstrument}">
<f:selectItems value="#{projectPageBean.instruments}"/>
<p:ajax event="change" listener="#{projectPageBean.valueChanged}" update="test" />
</p:selectOneMenu>
Within the same form I defined a p:commandButton component:
<p:commandButton id="test"
value="View Instrument"
action="#{projectPageBean.getPage}"
update="@this,:add-instrument-dialog-form:scrolladd"/>
Depending on the selectedInstrument from the selecOneMenu the navigation through the action attribute of the p:commandButton ought to be different.
The managed bean projectPageBean is request scoped.
Is this feasible or should I try a different approach?