1
votes

I am trying to Extend some of the primefaces components renderer class to make same changes i register new renderer in the faces config

<render-kit>
        <renderer>
            <component-family>org.primefaces.component</component-family>
            <renderer-type>org.primefaces.component.CommanButton</renderer-type>
            <renderer-class>ExtendedTags.myCommandButton</renderer-class>
        </renderer>
    </render-kit>

i can see that it calls the constructor of the renderer but not the other overridden functions encodeBegin encodeEnd etc. am i missing something? Is there any special addition for primefaces components? Here is my Renderer Class

public class myCommandButton extends CommandButtonRenderer{

    public myCommandButton() {
    System.out.println("button constructor");
    }



    @Override
    public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
        System.out.println("button encode begin");
        super.encodeBegin(context, component);
        ResponseWriter writer = context.getResponseWriter();
        writer.write("*");

    }



}
1

1 Answers

11
votes
        <renderer>
            <component-family>org.primefaces.component</component-family>
            <renderer-type>org.primefaces.component.CommandButtonRenderer</renderer-type>
            <renderer-class>ExtendedTags.myCommandButton</renderer-class>
         </renderer>