Search code examples
oracle-adf

af:table filter not keeping filtered value after ppr


Here is my use case :

  • Filter an ADF table with a column header filter
  • Then do an action that trigger a PPR on the table
  • The table is refreshed and the filter disapear. The data isn't filtered anymore.

How can i persist the VC filter when the table is refreshed ?

The table is bind to a view Object with a simple empty view Criteria as filter model :

<af:table value="#{bindings.myVO.collectionModel}"
  var="row"
  rows="#{bindings.myVO.rangeSize}"
  emptyText="#{Traduc_Lib['EmptyData']}"
  fetchSize="#{bindings.myVO.rangeSize}"
  rowBandingInterval="0" rowSelection="single" id="tO"
  styleClass="AFStretchWidth" autoHeightRows="5"
  columnStretching="column:c977" immediate="true"
  selectionListener="#{viewScope.myBean.mySelectionListener}"
  partialTriggers="::s73:cb4"
  contentDelivery="immediate"
  filterModel="#{bindings.myVOQuery.queryDescriptor}"
  queryListener="#{bindings.myVOQuery.processQuery}" varStatus="vs"
  selectedRowKeys="#{bindings.myVO.collectionModel.selectedRow}">

Solution

  • If you want to control that you need to utilize the filter facet of the <af:column> tag (https://docs.oracle.com/middleware/12212/adf/tag-reference-faces/tagdoc/af_column.html)

    Check this documentation on how to use the facet (http://www.oracle.com/technetwork/developer-tools/adf/learnmore/16-custom-table-filter-169145.pdf)

    Once you do that, you will have control over the <af:inputText> or <af:selectOneChoice> and you can retrieve its data back whenever needed.