我试图扩展PrimeFaces 1.0(是的,遗憾的是我们陷入了JSF 1.2)数据表,因为我希望内置的过滤器功能在整个字段中进行搜索,而不仅仅是在开头。所以我创建了一个扩展DataTableRenderer.java(Source code)的类:
package it.myPackage;
import ...
public class CustomDataTableRenderer extends org.primefaces.component.datatable.DataTableRenderer{
@Override
protected void decodeAjaxFilterRequest(FacesContext facesContext, DataTable dataTable) {
// the same method with a "contains" instead of a "startsWith"
}
}
我将此条目添加到faces-config:
<render-kit>
<renderer>
<component-family>org.primefaces.component</component-family>
<renderer-type>org.primefaces.component.DataTableRenderer</renderer-type>
<renderer-class>it.myPackage.CustomDataTableRenderer</renderer-class>
</renderer>
</render-kit>
但是从不调用overriden方法。我做错了什么?
平台:Java 6,JSF 1.2,Apache 6.0.18,Mojarra 1.2_12