Friday, November 4, 2011

ADF : Clean Table Filter Using Command Button

ADF Table and Form are the most used component by developer for day to day job. However , ADF Table component is out of box and there are various way we can customize to meet our requirement.

There is one of feature of ADF Table called in-build filter. However , For each column we have to press enter to search for our criteria.

image

After above filtering is done and if we want to clear the filter then we have to manually delete the text for all 3 filter and press enter.

Solution:- To solve this issue I created one button on Panelcollection component and bind action listener to following method and it took care of clearing all 3 value automatically and re rendering old result.

Note:-  I have managed bean with table binding available.

public void clearEmpQbeFilter(ActionEvent actionEvent) {        
    FilterableQueryDescriptor qd = 
                      (FilterableQueryDescriptor)t1.getFilterModel();
    if (qd != null && qd.getFilterCriteria() != null) {
      qd.getFilterCriteria().clear();
      t1.queueEvent(new QueryEvent(t1, qd));            
   }
}


All filter cleared and result re rendered.image

1 comment: