I am facing an issue after validations in JSF
Scenario - I have 2 drop downs and 2 input fields on the form. On selection of first drop down second one will populate and also the values of 2 text fields are depends on the first drop down selection.
1) So when I select some value from first drop down, second drop down and the text fields are populating with proper values. 2) when I click on submit button with out selecting the value from second drop down it is showing validation message as expected. 3) Now I changed the value of first drop down after validation error/fails. The values in text fields is not changing as required (means the text filed values are still showing old values) but the second drop down values are changing as expected.
Note:- Issue is only after validation fails.
<span class="col1 smallRightPadding marginBtmAdDiag">
<rich:select defaultLabel="Select bldng" enableManualInput="true"
id="search_bldng"
value="#{testManagedBean.bldng.bldngID}"
required="true" requiredMessage="#{testHome.selectBldng}">
<f:selectItemsvalue="#{testManagedBean.lstBldng}" var="bldngVar"
itemValue="#{bldngVar.bldngID}" itemLabel="#{bldngVar.bldngCode}">
</f:selectItems>
<a4j:ajax execute="@this" event="selectitem"
listener="#{testManagedBean.populateFloor}"
render="search_floor,hidSelBldng,hidSelFloor,hidSelbldngID" />
</rich:select>
<h:inputHidden id="hidSelBldng" value="#{testManagedBean.bldng.bldngCode}" />
<h:inputHidden id="hidSelbldngID" value="#{testManagedBean.bldng.bldngID}" />
</span>
<rich:select defaultLabel="Select Floor" enableManualInput="true"
id="search_floor"
value="#{testManagedBean.floor.floorID}"
required="true"
requiredMessage="#{testHome.selectFloor}">
<f:selectItems value="#{testManagedBean.floorLst}"
var="flr" itemValue="#{flr.floorID}"
itemLabel="#{flr.floorName}">
</f:selectItems>
</rich:select>
<h:commandButton id="goButtonId" value="#{testHome.goButton}" styleClass="saveButton">
<a4j:ajax event="click" execute="@form" oncomplete="drawLayerFromBtn();"
listener="#{testManagedBean.viewReport}"
render="tableId,hidSelFloor"/>
</h:commandButton>