0 Replies Latest reply on Oct 18, 2011 3:04 AM by sharanya

    Seam Stateless: Chained JSF SelectOneMenu: Validation Error: Value is not valid".

    sharanya
      Hi All,

      I am using Seam Stateless Beans. I have chained JSF SelectOneMenus on my UI named Country and State. On changing the country an ajax call is made and the state SelectOneMenu gets populated.

      Everytime the form is submitted I am getting a JSF validation error on the State field stating "Validation Error: Value is not valid".

      I tried saving the bean which contains the state foeld in something permanant that is the portlet session everytime a state is selected. Also tried placing the states list in the portlet session everytime a country selected, but I am getting the same error. I also tried placing just the bean holding the information entered on the form in page scope. Still the error occurs.

      Can anyone please help on how to resolve this issue.

      Please find below code snippet of the country and state selectoneMenu in the xhtml page.

      <tr>
           <td><h:outputText value="#{customerRegisterLabels.COMPANY_COUNTRY}"/><span      class="mandatoryField">*</span></td>
           <td class="indentLeft">
                <div class="langdrop1">
                    <div class="selectBoxWhite1" id="globalSelctBox" style="display: inline-block;float:left;">
                        <div class="options1">
                            <h:selectOneMenu tabindex="4" id="companyCountry" value="#  {customerRegistrationVO.companyCountry}" required="true" requiredMessage="#{customerRegisterValidateMsgs.COMPANY_COUNTRY_BLANK}" style="width:136px;">
                                   <f:selectItems value="#{customerAction.findCountries()}" var="country" label="#{country.label}" />
                                   <a:support event="onchange" reRender="companyState" ajaxSingle="true" actionListener="#{customerAction.populateCompanyCountryEvent}"/>
                            </h:selectOneMenu>
                        </div>
                     </div>
                </div>
           </td>
           <td><h:message for="companyCountry" style="color:#ff0000" showSummary="true" showDetail="false"/></td>
      </tr>
      <tr>
           <td><h:outputText value="#{customerRegisterLabels.COMPANY_STATE}"/><span class="mandatoryField">*</span></td>
           <td class="indentLeft">
               <div class="langdrop1">
                <div class="selectBoxWhite1" id="globalSelctBox" style="display: inline-block;float:left;">
                         <div class="options1">
                             <h:selectOneMenu tabindex="5" id="companyState" value="#{customerRegistrationVO.companyState}" required="true" requiredMessage="#{customerRegisterValidateMsgs.COMPANY_STATE_BLANK}" style="width:136px;">
                                  <f:selectItems value="#{customerAction.findCountryStates(customerRegistrationVO.companyCountry)}" var="state" label="#{state.label}"/>
                                   <a:support event="onchange" ajaxSingle="true" actionListener="#{customerAction.populateCompanyStateEvent}"/>
                              </h:selectOneMenu>
                            </div>
                   </div>
                </div>
            </td>
            <td><h:message for="companyState" style="color:#ff0000" showSummary="true" showDetail="false"/></td>
      </tr>