I have encode method of custom renderer for UIInput
.
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
String ClientId = component.getClientId(context);
String hint = (String) component.getAttributes().get("placeholder");
String styleClass = (String) component.getAttributes().get("styleClass");
String value = (String) component.getAttributes().get("value");
ResponseWriter writer = context.getResponseWriter();
writer.writeAttribute("name", ClientId, null);
writer.writeAttribute("placeholder", hint, "hint");
writer.startElement("input", component);
writer.writeAttribute("class", styleClass, "styleClass");
writer.writeAttribute("value", ((UIInput) component).getValue(), "value");
writer.endElement("input");
}
I'm write startElement
after I wrote 2 attributes, but it works. I.e. how startElement
method does work? Does we can startElement
anywhere before endElement
and after endElement
of previous element
.