I have the following Dropdown list, which has a Event associated with it, when user select a value from this dropdown the rest of the dropdown lists along with a table are filled accordingly:
<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>
i also have a h:commandButton
as below:
<TD>
<h:commandButton id="btnCheckVals" value="Submit"
onclick="return checkSelectedVal(this);"
></h:commandButton>
</TD>
When i click the "Submit" button, the Event associated with above dropdown is called and the javascript function is never called! is the the expected behaviour ? and if so how can i make it so the javascript function is called before the event is fired allowing to check if user has selected values from dropdowns.