【问题标题】:Filter on adf Table using view object使用视图对象过滤 adf 表
【发布时间】:2018-01-16 13:17:15
【问题描述】:

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

jsff 页面

<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

【问题讨论】:

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


    【解决方案1】:

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

    "... ……”

    将绑定设置为正确的迭代器。我遇到了类似的问题,这对我有用。

    【讨论】:

      猜你喜欢
      • 2017-02-18
      • 1970-01-01
      • 1970-01-01
      • 2015-10-19
      • 2017-06-14
      • 2019-01-24
      • 1970-01-01
      • 2018-12-14
      • 2020-11-01
      相关资源
      最近更新 更多