使用视图对象在adf表上过滤

时间:2018-01-16 13:17:15

标签: oracle-adf jdeveloper tablefilter adf-task-flow

我需要在af:table上使用过滤器,已尝试使用原生adf方法filterVisible="true"并设置filterable="true",但它不会在表格上返回结果。还尝试使用manageBean方法执行此操作,我将在下面发布:

jsff page

<af:commandButton text="Filter" id="cb1" actionListener="#
{pageFlowScope.paisMB.filterTableAction}"/>

<af:table value="#{bindings.PaisUVO.collectionModel}" var="row"
              rows="#{bindings.PaisUVO.rangeSize}"
              emptyText="#{bindings.PaisUVO.viewable ? 'No data to display.' : 'Access Denied.'}"
              fetchSize="#{bindings.PaisUVO.rangeSize}"
              rowBandingInterval="0" styleClass="AFStretchWidth"
              selectionListener="#{bindings.PaisUVO.collectionModel.makeCurrent}"
              rowSelection="single" id="t1" binding="#{pageFlowScope.paisMB.tableData}"
              scrollPolicy="page" autoHeightRows="0"
              filterModel="#{bindings.PaisUVOQuery.queryDescriptor}"
              queryListener="#{bindings.PaisUVOQuery.processQuery}" filterVisible="true">
        <af:column sortProperty="#{bindings.PaisUVO.hints.NewsiteOxiLingua.name}"
                    sortable="false"
                    headerText="#{bindings.PaisUVO.hints.NewsiteOxiLingua.label}"
                    id="c6">
            <af:outputText value="#{row.NewsiteOxiLingua}" id="ot3"/>
         </af:column>

         <af:column sortProperty="#{bindings.PaisUVO.hints.NewsiteOxiPaisesPk.name}"
                    sortable="false"
                    headerText="#{bundle['lbl_codigo']}"
                    id="c5">
            <af:outputText value="#{row.NewsiteOxiPaisesPk}" id="ot4">
               <af:convertNumber groupingUsed="false"
                            pattern="#{bindings.PaisUVO.hints.NewsiteOxiPaisesPk.format}"/>
            </af:outputText>
         </af:column>

         <af:column sortProperty="#{bindings.PaisUVO.hints.NewsiteOxiPaisesNome.name}"
                    sortable="false" filterable="true"
                    headerText="#{bundle['lbl_pais']}"
                    id="c7">
            <af:outputText value="#{row.NewsiteOxiPaisesNome}" id="ot2"/>
         </af:column>
</af:table>

我想过滤我的最后一列。下面是我搜索按钮的java代码。

管理Bean页面

private transient RichTable tableData;
private RichInputText countryName;
public void filterTableAction(ActionEvent actionEvent) {
    RichTable tb1 = this.getTableData();
    FilterableQueryDescriptor filterQD = (FilterableQueryDescriptor)tb1.getFilterModel();
    Map filterCriteria = filterQD.getFilterCriteria();
    filterCriteria.put("NewsiteOxiPaisesNome", countryName.getValue());
    LOGGER.warning("Filter Criteria : " + filterCriteria);
    getTableData().queueEvent(new QueryEvent(getTableData(), filterQD));
    AdfFacesContext.getCurrentInstance().addPartialTarget(this.getTableData());
    LOGGER.warning("OnFilterTable Action is Called : " + filterQD);
}

我的表基于视图对象。谁能告诉我我做错了什么。我的表只是不返回搜索结果,也没有给出任何错误。 如果还有其他更好的方法,我愿意接受建议。 jdev的版本是11.1.1.7.0

1 个答案:

答案 0 :(得分:0)

在定义此页面绑定的pageDef.xml文件中的可执行文件下,确保您具有PaisUVOQuery searchRegion。 它定义了过滤器用于搜索的搜索区域。 E.g。

&#34; ...            ...&#34;

将Binds设置为正确的迭代器。我有类似的问题,这对我有用。

相关问题