@Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
if (!component.isRendered()) return;
super.encodeBegin(context, component);
ForEach forEach = (ForEach) component;
forEach.cleanData();
forEach.setObjectId(null);
String wrapperTagName = forEach.getWrapperTagName();
if (wrapperTagName == null || wrapperTagName.length() == 0)
return;
ResponseWriter writer = context.getResponseWriter();
String clientId = forEach.getClientId(context);
writer.startElement(wrapperTagName, forEach);
writer.writeAttribute("id", clientId, null);
String classStr = Styles.getCSSClass(context, forEach, forEach.getStyle(), forEach.getStyleClass());
if (classStr != null) {
writer.writeAttribute("class", classStr, null);
}
Styles.renderStyleClasses(context, forEach);