Code to reset or clear af:table filter- here searchTabBind is the binding of af:table
use this method on any button or link to clear af:table filter
/** * method to reset filter attributes on an af:table * @param actionEvent event which triggers the method */ public void resetTableFilterAction(ActionEvent actionEvent) { FilterableQueryDescriptor queryDescriptor = (FilterableQueryDescriptor) getSearchTabBind().getFilterModel(); if (queryDescriptor != null && queryDescriptor.getFilterConjunctionCriterion() != null) { ConjunctionCriterion cc = queryDescriptor.getFilterConjunctionCriterion(); List<Criterion> lc = cc.getCriterionList(); for (Criterion c : lc) { if (c instanceof AttributeCriterion) { AttributeCriterion ac = (AttributeCriterion) c; ac.setValue(null); } } getSearchTabBind().queueEvent(new QueryEvent(getSearchTabBind(), queryDescriptor)); } }
use this method on any button or link to clear af:table filter