1 Reply Latest reply on Aug 8, 2011 6:52 PM by kragoth

    h:selectBooleanCheckbox - trigger event?

    ginni

      I have a data table in a page and want to allow users to check a box and then rerender the table to include (or remove) archived records. On my page I have:




       <h:selectBooleanCheckbox id="includeArchive" 
             value="#{requestListManager.includeArchive}" 
             title="Include Archived"
              immediate="true"
              style="padding-left: 4px"/>
              <a4j:support event="onclick" 
            reRender="requestListTable, approveListTable, requestListTableScroller, approveListScroller" 
            requestDelay="500" 
            ajaxSingle="true"/>
            <h:outputText value="Include Archived"
                style="padding-left: 4px"/>
      



      And in my bean, I have:




      ...
          private Boolean includeArchive = Boolean.FALSE;
      ...
          public Boolean getIncludeArchive() {
           return includeArchive;
          }
      
          public void setIncludeArchive(Boolean includeArchive) {
              this.includeArchive = includeArchive;
          }
      ...
      
      



      I click the box and nothing happens. I want to refresh the table contents (which should rerun the query behind the scenes. I am sure this is a simple thing, but I don't know what I am missing. Please advise.


      Thanks,
      Ginni



        • 1. Re: h:selectBooleanCheckbox - trigger event?
          kragoth

          Well, my guess is that it's because you don't have your a4j:support tag inside your selectBooleanCheckbox.


          Try it like this maybe?


           <h:selectBooleanCheckbox id="includeArchive" 
                 value="#{requestListManager.includeArchive}" 
                 title="Include Archived"
                  immediate="true"
                  style="padding-left: 4px">
                  <a4j:support event="onclick" 
                reRender="requestListTable, approveListTable, requestListTableScroller, approveListScroller" 
                requestDelay="500" 
                ajaxSingle="true"/>
          </h:selectBooleanCheckbox>
                <h:outputText value="Include Archived"
                    style="padding-left: 4px"/>