I had to write some own renderers for my project and work perfectly. However, I am somewhat confused by some parameters in the ResponseWriter methods. The documentation does not explain this very well, so I hope one of the JSF resident experts can explain it better. In particular:
public abstract void startElement(java.lang.String name, javax.faces.component.UIComponent component) throws java.io.IOException Parameters: name - Name of the element to be started component - The UIComponent (if any) to which this element corresponds
What does this second parameter do? Does it seem to work fine for me to skip "null" or "this" in my renderer?
Similarly for writeAttribute:
public abstract void writeAttribute(java.lang.String name, java.lang.Object value, java.lang.String property) throws java.io.IOException Parameters: name - Attribute name to be added value - Attribute value to be added property - Name of the property or attribute (if any) of the UIComponent associated with the containing element, to which this generated attribute corresponds
Why should ResponseWriter know the backing property? Again, this seems like normal if I pass null or "styleClass" when writing a class attribute.
Curious minds want to know, and my google-fu fails on this ...
source share