4

I'm trying to extend the PrimeFaces 1.0 (yep, sadly we are stuck at JSF 1.2) data table, because I want the built-in filter function to search in the whole field, instead of only at the beginning. So I created a class which extendes 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"
    }
}

And I added this entry to the 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>

But the overriden method is never called. What am I doing wrong?

Platform: Java 6, JSF 1.2, Apache 6.0.18, Mojarra 1.2_12

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Nicola Isotta
  • 202
  • 3
  • 10
  • Should work fine. Sure that clean/rebuild/redeploy/restart went well? Is it registered in webapp's own faces-config (and not a "custom library" JAR's one)? Is the custom renderer class' constructor ever hit? – BalusC Dec 06 '13 at 16:59
  • Yep, seems like a Woodstock/webuijsf file prevented a full clean and I didn't notice it. Now the method is called. Thanks! – Nicola Isotta Dec 06 '13 at 20:24

0 Answers0