1 Reply Latest reply on Jun 30, 2011 3:28 PM by jeffpoos

    Rerender of component even with validation error

    jeffpoos

      Hello i have a problem.  When i change the value of scheduleFrequency selectOneListbox it causes validation to be fired. I then show/hide the selectManyCheckbox.   The show/hide does not happen when there is a validation error. I have a @NotNull annotaion on the scheduleBean.scheduleMetaDataDTO.scheduleFrequency.  When i select the null option i need it to hide the selectManyCheckbox even if a validation error is thrown.  Is there a way to disable validation for the ajax call only?  Below is the section of code

       

                          <h:panelGrid columns="2" rendered="#{scheduleBean.scheduleMetaDataDTO.scheduleTypeReccuring}">
                                   <h:selectOneListbox value="#{scheduleBean.scheduleMetaDataDTO.scheduleFrequency}"
                                      size="1" id="scheduleFrequency">
                                      <f:selectItem itemValue="#{null}" itemLabel="Select..." />
                                      <f:selectItems value="#{scheduleBean.scheduleFrequencies}" />
                                      <a4j:ajax event="change" render="dailyCheckboxes" execute="@this"/>
                                  </h:selectOneListbox>
                                  <a4j:outputPanel id="dailyCheckboxes">
                                      <h:selectManyCheckbox value="#{scheduleBean.scheduleMetaDataDTO.selectedDays}"
                                          rendered="#{scheduleBean.showDaysCheckboxes}"
                                          layout="lineDirection">
                                          <f:selectItems value="#{scheduleBean.days}" />
                                      </h:selectManyCheckbox>
                                  </a4j:outputPanel>
                              </h:panelGrid>
      
        • 1. Re: Rerender of component even with validation error
          jeffpoos

          The rendered="#{scheduleBean.showDaysCheckboxes}" basically checkes if the value scheduleFrequency is not null and a value.  I understand the when validation fails the scheduleFrequency is not updated with the null selected value.  Is there anyway to hide the checkboxes when i see an error message for id="scheduleFrequency"?