I created a separated Managed Bean to load State and City.
I need to pass State value to the Bean, but I getting a null value.
<p:selectOneMenu id="cgStage" value="#{order.cgState}">
<f:selectItems value="#{stateCityBean.lstState}" var="state"
itemValue="#{state.cgState}"
itemLabel="#{state.noState}" />
<p:ajax listener="#{stateCityBean.listCities}" update="cgCity">
<f:setPropertyActionListener
target="#{stateCityBean.cgState}"
value="#{order.cgState}" />
</p:ajax>
</p:selectOneMenu>
<p:selectOneMenu id="cgCity" value="#{order.cgCity}">
...
</p:selectOneMenu>
Is there any way to get the SelectOneMenu value direct from component?
I tried get [copmonent.value], but didn't work either. Something like that:
<p:selectOneMenu ...
<p:ajax listener="#{stateCityBean.listCities}" update="cgCity">
<f:setPropertyActionListener
target="#{stateCityBean.cgState}"
value="#{component.value}" />
</p:ajax>
</p:selectOneMenu>
Thank you guys
PS: I know I could do that with a [commandButton], but I'm using a template and the save button is outside my page.