Pessoal
Tenho o seguinte codigo JSF. O problema e que toda vez que eu to selecionando o pais ele dispara tanto o
metodo carregar Estados quanto o carregarCidades, quando era so pra disparar o carregarEstados. Alguem sabe dizer pq ta acontecendo isso?
obg
<h:outputText id="pais" value="País:" />
<h:selectOneMenu
value="#{cadastroUsuario.pais}"
valueChangeListener="#{cadastroUsuario.carregarEstados}"
onchange="submit()">
<f:selectItem itemLabel="SELECIONE UM PAIS" itemValue="none"/>
<f:selectItems id="paises" value="#{cadastroUsuario.paises}"/>
</h:selectOneMenu>
<br>
<!-- Estado -->
<h:outputText id="estado" value="Estado:"/>
<h:selectOneMenu id="idEstado"
value="#{cadastroUsuario.estado}"valueChangeListener="#{cadastroUsuario.carregarCidades}"
onchange=="submit()">
<f:selectItem itemLabel="SELECIONE UM ESTADO" itemValue="none"/>
<f:selectItems id="estados" value="#{cadastroUsuario.estados}"/>
</h:selectOneMenu>
<br>
<!-- Cidades -->
<h:outputText id="cidade" value="Cidade:"/>
<h:selectOneMenu id="idCidade"
value="#{cadastroUsuario.cidade}">
<f:selectItem itemLabel="SELECIONE UMA CIDADE" itemValue="none"/>
<f:selectItems id="cidades" value="#{cadastroUsuario.cidades}"/>
</h:selectOneMenu>
<br>