我正在尝试将过滤添加到 rich:datatable 但是我遇到了 PropertyNotFoundException 的问题 - 使用展示中的示例(Richfaces 4)我有以下内容
<f:facet name="noData">
Nothing found
</f:facet>
<rich:column filter="#{mailerBean.firstNameFilterImpl}">
<f:facet name="header">
<h:outputText value="First Name" />
<h:inputText value="#{mailerBean.firstNameFilter}" id="input">
<a4j:ajax event="blur" render="dataTable" execute="@this" />
</h:inputText>
</f:facet>
<h:outputText value="#{person.firstName}" />
</rich:column>
Bean包含
@ManagedBean
@SessionScoped
public class MailerBean implements Serializable {
............
public String getFirstNameFilter() {
return firstNameFilter;
}
public void setFirstNameFilter(String firstNameFilter) {
this.firstNameFilter = firstNameFilter;
}
public Filter<?> getFirstNameFilterImpl() {
return new Filter<Person>() {
public boolean accept(Person t) {
String firstName = getFirstNameFilter();
if (firstName == null || firstName.length() == 0 ||
firstName.toLowerCase().contains(t.getFirstName().toLowerCase())) {
return true;
}
return false;
}
};
我得到的错误是
javax.el.PropertyNotFoundException:/ mailinglistpage.xhtml @ 66,67 filter =“#{mailerBean.firstNameFilterImpl}”:属性 在类型上找不到'firstNameFilterImpl' com.patcomsys.zuzz.mailer.web.MailerBean
该方法在bean中,它确实返回一个Filter对象 - 你能看到什么错误吗?
由于