Being a newbie at JSF, I've ran into a situation that I don't understand how to solve. I have a page with 2 selectOneMenu objects (financialColumn, linesOfBusiness) depending on the values of 2 other selectOneMenu objects (year, businessType). The contents of financialColumn & linesOfBusiness can be completely different depending on year or businessType selected (all components are RequestScoped beans).
<h:outputText value="Data Year:" />
<h:selectOneMenu id="year" value="#{YearOptions.year}" >
<f:selectItems value="#{YearOptions.options}" />
<f:ajax execute="@this businesstype" render="financialColumn linesOfBusiness" />
</h:selectOneMenu>
<h:outputText value="Business Type:" />
<h:selectOneMenu id="businesstype" value="#{BusTypeOptions.busListKey}" >
<f:selectItems value="#{BusTypeOptions.options}" />
<f:ajax execute="@this year" render="financialColumn linesOfBusiness" />
</h:selectOneMenu>
<h:outputText value="Select Financial Amount to Report on:" />
<h:selectOneMenu id="financialColumn" value="#{FinColumn.finColumn}">
<f:selectItems value="#{FinColumn.options}"/>
</h:selectOneMenu>
<h:outputText value="Select Lines of Business to include:" />
<h:selectManyListbox id="linesOfBusiness" value="#{LobOptions.linenums}" size="5" >
<f:selectItems value="#{LobOptions.options}"/>
</h:selectManyListbox>
:
:
<h:commandButton value="Submit" type="submit" action="/pages/report/lines-of-business-summary"
The issue I'm trying to figure out is as long as I don't change or go back to the original values of financialColumn & linesOfBusiness my report page displays but when I change businessType value which causes complete change in financialColumn & linesOfBusiness values then I receive "•criteria:financialColumn: Validation Error: Value is not valid". Why is this happening and how can I fix it?
Thanks