1 Reply Latest reply on Nov 27, 2008 10:41 AM by nbelaevski

    selectOneMenu reRendered required validation not firing

    achildress

      I have a selectOneMenu that is reRendered when a selection is made in another selectOnemenu. The selectOneMenu that is reRendered has a rendered attribute so that it doesn't display until a selection is made in the related selectOneMenu. The problem is that once it is rendered, the value of the second selectOneMenu is never submitted and the required validation is never fired for it. Is there some way around this?

      <h:selectOneMenu id="comCountyCombo" label="Committing County" required="true"
       requiredMessage="Committing County: Value is required."
       converter="selectonemenublank"
       value="#{DCCPPOAssignmentsBean.committingCounty}">
       <f:selectItems
       value="#{CodeCacheBean.getDCCOfficeCounties$[StaffBean.facilityID][true]}"/>
       <a4j:support event="onchange" reRender="zoneddarea"/>
      </h:selectOneMenu>
      <a4j:outputPanel id="zoneddarea">
       <h:selectOneMenu id="diagZoneCombo" label="Zone" required="true"
       requiredMessage="Zone: Value is required."
       converter="selectonemenublank"
       value="#{DCCPPOAssignmentsBean.zone}"
       rendered="#{DCCPPOAssignmentsBean.committingCounty != ''}">
       <f:selectItems
       value="#{CodeCacheBean.getDCCZones$[DCCPPOAssignmentsBean.committingCounty][true]}"/>
       </h:selectOneMenu>
      </a4j:outputPanel>
      


      When a selection is made on comCountyCombo, then zoneddarea is reRendered (zoneddarea is an a4j:outputPanel that contains the second selectOneMenu that should not be displayed until a selection is made from the first selectOneMenu). Then, when a selection is made on diagZoneCombo and the page is submitted, the value of the selected diagZoneCombo item is not submitted AND required validation is completely skipped. The backing bean is in request scope. Is the scope the problem?