9 Replies Latest reply on Apr 15, 2009 9:27 AM by elf

    Check box filtering

    elf

      Hi

      In case of livedemo
      http://livedemo.exadel.com/richfaces-demo/richfaces/extendedDataTable.jsf;jsessionid=26AD6CE41F48790B5BE6143E864E22CC?c=extendedDataTable&tab=usage

      Is it possible to create column with boolean type (check boxes) and use filter (check box) for filtering records with true or false ?
      In case of yes, please post simple example how to configure such filter.

        • 1. Re: Check box filtering
          ilya_shaikovsky

          simple sample

           <rich:column filterExpression="#{cap.checked == filteringBean.filterChecked}">
           <f:facet name="header">
           <h:selectBooleanCheckbox value="#{filteringBean.filterChecked}" >
           <a4j:support event="onclick" reRender="table , ds2"
           ignoreDupResponses="true" requestDelay="700"
           />
           </h:selectBooleanCheckbox>
           </f:facet>
           <h:selectBooleanCheckbox value="#{cap.checked}" />
           </rich:column>
          
          




          • 2. Re: Check box filtering
            elf

            In this case check box is situated in header section instead of some header text.
            Is it possible to put in in filter section ?
            Is it possible do not display drop down list on particular column header with sorting, grouping and visibility ?
            Thanks in advance.

            • 3. Re: Check box filtering
              ilya_shaikovsky

              You could try next facet. But unfortunatelly this is undocumented feature currently.

               <f:facet name="filterValueInput">
               <h:selectBooleanCheckbox value="" />
               </f:facet>
              


              • 4. Re: Check box filtering
                elf

                Ilya, thank you.
                Is it possible do not display drop down list on particular column header with sorting, grouping and visibility ?

                • 5. Re: Check box filtering
                  ilya_shaikovsky

                  yes. just define enableContextMenu=false on column ;)

                  • 6. Re: Check box filtering
                    elf

                    Ilya,

                    I try to create column programmatically.
                    I tried to do as

                    column.getAttributes.put("enableContextMenu", false);
                    

                    or
                    column.getAttributes.put("enableContextMenu", "false");
                    

                    but is not work. What I am doing wrong ?

                    As for the check box,
                    using <f:facet name="filterValueInput"> do not work for me. I use RF 3.3.0.
                    column.getFacets().put("filterValueInput", checkBoxHeader);
                    

                    When I use it as
                    column.getFacets().put("header", checkBoxHeader);
                    

                    it works, but it is a bit ugly :(

                    • 7. Re: Check box filtering
                      elf

                      Ilya, could you please comment?
                      What I am doing wrong ?

                      • 8. Re: Check box filtering
                        ilya_shaikovsky

                        sorry :( I was sure that this attribute should available on the column. But it's implemented for the table and disables all the menus..
                        About the second question could you please check if the same facet defined on the page instead of programatically will works please.

                        • 9. Re: Check box filtering
                          elf

                          I check source code (html) of the generated page, but there are no such facet :(