Search code examples
oracle-databasejsforacle-adfjdeveloper

How to filter results of an adf table without changing query?


I have a table on my .jsf page. I need to filter its results without changing the main query as this query is commonly used in the entire project. I need something like

do not bring the results with rel_tp_id = 1128500

of which the User should not see.

Here is the query:

     <af:query id="qryId2" headerText="#{res['global.search.krtr']}" disclosed="true"
                    value="#{bindings.CharRelSearchVOCriteriaQuery.queryDescriptor}"
                    model="#{bindings.CharRelSearchVOCriteriaQuery.queryModel}"
                    queryListener="#{bindings.CharRelSearchVOCriteriaQuery.processQuery}"
                    queryOperationListener="#{bindings.CharRelSearchVOCriteriaQuery.processQueryOperation}"
                    saveQueryMode="hidden" modeChangeVisible="false" resultComponentId="::pc1:resId2"/>

And here is the table:

            <af:table value="#{bindings.CharRelSearch.collectionModel}" var="row"
                      rows="#{bindings.CharRelSearch.rangeSize}"
                      emptyText="#{res['global.table.noDataMessage']}"
                      rowBandingInterval="1"
                      selectedRowKeys="#{bindings.CharRelSearch.collectionModel.selectedRow}"
                      selectionListener="#{bindings.CharRelSearch.collectionModel.makeCurrent}"
                      rowSelection="single" id="resId2"
                      styleClass="AFStretchWidth" columnStretching="last"
                      fetchSize="#{bindings.CharRelSearch.rangeSize}"
                      binding="#{charRelSearchBean.charRelResultTable}"
                      partialTriggers="::ctb2 ::ctb3 :::cb1 :::qryId2">

I appreciate all the help. Thanks!


Solution

  • Add a view criteria that has the conditions you want to apply to your View Object that populates the table. https://blogs.oracle.com/jdevotnharvest/whats-the-difference-between-view-criteria-and-where-clause