use of javax.faces.component.UIPanel in project acs-community-packaging by Alfresco.
the class UISearchCustomProperties method encodeBegin.
/**
* @see javax.faces.component.UIComponentBase#encodeBegin(javax.faces.context.FacesContext)
*/
@SuppressWarnings("unchecked")
public void encodeBegin(FacesContext context) throws IOException {
if (isRendered() == false) {
return;
}
ResponseWriter out = context.getResponseWriter();
if (getChildCount() == 0) {
createComponentsFromConfig(context);
}
// encode the components in a 3 column table
out.write("<table cellspacing=2 cellpadding=2 border=0");
outputAttribute(out, getAttributes().get("styleClass"), "class");
outputAttribute(out, getAttributes().get("style"), "style");
out.write('>');
List<UIComponent> children = getChildren();
int colCounter = 0;
for (int i = 0; i < children.size(); i++) {
UIComponent component = children.get(i);
if (component instanceof UIPanel) {
out.write("<tr><td colspan=3>");
Utils.encodeRecursive(context, component);
out.write("</td></tr>");
colCounter += 3;
} else {
if ((colCounter % 3) == 0) {
out.write("<tr>");
}
out.write("<td>");
Utils.encodeRecursive(context, component);
out.write("</td>");
if ((colCounter % 3) == 2) {
out.write("</tr>");
}
colCounter++;
}
}
out.write("</table>");
}
Aggregations