Hello. I have the following code
<h:selectOneMenu id="kkk" value="#{topologyBean.country}">
<f:selectItem itemValue="" itemLabel="" />
<f:selectItems value="#{topologyBean.countryList}" var="country"
itemValue="#{country.countryLabel}"
itemLabel="#{country.countryValue}" />
<a4j:ajax listener="#{topologyBean.changeCountry}" render="momo" />
<rich:validator/>
</h:selectOneMenu>
<a4j:outputPanel id="momo">
<h:outputLabel value="" for="cities" />
<h:selectOneMenu id="cities" value="#{topologyBean.city}" rendered="#{topologyBean.cities ne null}">
<f:selectItems value="#{topologyBean.cities}" var="cityname"
itemValue="#{cityname.citiesLabel}" />
<rich:validator/>
</h:selectOneMenu>
</a4j:outputPanel>
and i have jsr303 validation NotNull.
1) At the beginning i have only the first list and i press the submit button. I get for the second list ' value cannot be null '
2) When i change the value from the first list then the validation message from the second list disappears. As if i have not submitted the form. How can i make the validation in the second list remain even if i change the value in the fitrst list
thank you a lot
Antonios
Hi,
Client side validation is done using rich:validator,
Validating component should refer a backing bean
try add
<rich:message for ="cities"/> after <h:selectOneMenu>
Thanks,
Siva