我需要在我的 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