3 Replies Latest reply on Jul 29, 2013 10:44 AM by Timo Hahn

    How to reset table filters in 12c?

    Jhon Carrillo

      Hi all,

       

      According to the 12c compiler, the mehtod getFilterCriteria() is deprecated. I was using this method in 11g to clear table filters.

       

      So, the question is:

       

      What is the new way to reset table filters in 12c?

       

      Jhon

      jdev 12c

        • 1. Re: How to reset table filters in 12c?
          Timo Hahn

          Jhon,

          jup, they changes they changed the filter handling a bit.

          try this code to reset the filter:

              public void resetTableFilter(ActionEvent actionEvent)

              {

                  FilterableQueryDescriptor queryDescriptor =

                      (FilterableQueryDescriptor) getEmpTable().getFilterModel();

                  if (queryDescriptor != null && queryDescriptor.getFilterConjunctionCriterion() != null)

                  {

                      ConjunctionCriterion cc = queryDescriptor.getFilterConjunctionCriterion();

                      List<Criterion> lc = cc.getCriterionList();

                      for (Criterion c : lc) {

                          AttributeCriterion ac = (AttributeCriterion) c;

                          ac.setValue(null);

                      }

                      getEmpTable().queueEvent(new QueryEvent(getEmpTable(), queryDescriptor));

                  }

              }

           

          I'll write up the long explanation in a blog tomorrow.

           

          Timo

          • 2. Re: How to reset table filters in 12c?
            Jhon Carrillo

            Works!!   Thanks Timo.

             

            Respecting to prevent the first data load in a table when the page load, Are there new strategies?  #{!adfFacesContext.initialRender} is not working anymore.

             

            Jhon

            • 3. Re: How to reset table filters in 12c?
              Timo Hahn

              Different question should be posted in a new thread.

              And provide a sample where it doesn't work!

               

              Timo