I have the following dropdown which list couple of cars, I have it so that it stores the value of selected item in a backbean variable and an event is fired so other dropdowns would fill up according to the selected value of this dropdown control as below:
<Td>
<h:selectOneMenu id="combocarList"
value="#{customerBean.selectedcar}"
styleClass="comboStyle"
valueChangeListener="#{customerBean.loadothercombos}"
onchange="document.forms[0].submit()"
>
<f:selectItem
itemLabel="-----------Select--------------"
itemValue="None" />
<f:selectItems value="#{customerBean.carsList}" />
</h:selectOneMenu>
</Td>
Problem is when an item selected from the above dropdown, the event loadothercombos is called before the setter which causes problems.
Note that the backbean customer is defined as:
<managed-bean-name>customerBean</managed-bean-name>
<managed-bean-class>com.theway.customer</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
The behaviour i see in debugging that when i select an item from dropdown:
1) Getter is called for selectedcar
2) Loadothercombos is called <------- This is called by the event
3) Setter is called for selectedcar
I cannot get it to call the setter before calling loadothercombos. Any insight would be appreciated. Thanks