header = CreateComponentUtils.createComponent(facesContext, ComponentTypes.PANEL, null, "_header");
header.setTransient(true);
final List<AbstractUIColumn> columns = sheet.getAllColumns();
int i = 0;
for (final AbstractUIColumn column : columns) {
final AbstractUIOut out = (AbstractUIOut) CreateComponentUtils.createComponent(
facesContext, ComponentTypes.OUT, RendererTypes.OUT, "_col" + i);
out.setTransient(true);
// out.setValue(column.getLabel());
ValueExpression valueExpression = column.getValueExpression(Attributes.LABEL);
if (valueExpression != null) {
out.setValueExpression(Attributes.VALUE, valueExpression);
} else {
out.setValue(column.getAttributes().get(Attributes.LABEL));
}
valueExpression = column.getValueExpression(Attributes.RENDERED);
if (valueExpression != null) {
out.setValueExpression(Attributes.RENDERED, valueExpression);
} else {
out.setRendered((Boolean) column.getAttributes().get(Attributes.RENDERED));
}
header.getChildren().add(out);
i++;
}
sheet.setHeader(header);