2 Replies Latest reply on Oct 1, 2007 9:55 AM by daedlus

    a4j problem

    daedlus

      w.r.t code below:
      i have checkboxes with select all and unselect all button.

      <h:selectManyCheckbox id="id_cb" value="#{myBean.selectedItems}" required="true">
       <f:selectItems value="#{myBean.allItems}" />
      <a4j:support event="onclick" actionListener="#{myBean.onItemSelect}" reRender="unselect,selectall"/>
      </h:selectManyCheckbox>
      
      
      a4j:region>
      <a4j:commandButton id="selectall" value="selectAll" reRender="id_cb" actionListener="#{myBean.selectAll}" immediate="true" />
      <a4j:commandButton id="unselectall" value="unselectAll" reRender="id_cb" actionListener="#{myBean.unselectAll}" immediate="true"/>
      </a4j:region>
      


      the following use case fails.
      if user de-selects all checkboxes then unselectall shud be disabled , but its not .. instead validation error is thrown.
      how do i bypass that required="true" when user is deselecting all check boxes.
      thx


        • 1. Re: a4j problem
          ilya_shaikovsky

          If you skip the required for a:support - the error will not be thrown for other cases also :)

          2)I can't see any reRender on your support.. So how you will update the buttons?

          • 2. Re: a4j problem
            daedlus

            i missed the render on buttons while pasting here.

            all use cases are working except the one i mentioned above.
            Is removing the required = true for h:selectmanyCheckBox the only way? to make it work