JSF 2.0 Migrating PrimeFaces Rendering

I am trying to extend some of the components of the component render class to perform the same changes. I register a new renderer in face configs

<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 it is calling the renderer constructor, but not the other overridden functions encodeBegin encodeEnd etc. Did I miss something? Is there any special addition for surface 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("*");

    }



}

      

+2


source to share


1 answer


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

      



+12


source







All Articles