public void encode(FacesContext context, Column column) throws IOException {
ColumnGroup group = findGroup(column);
DataTable table = (DataTable) group.getParent();
String type = group.getType();
DataTableRenderer renderer = (DataTableRenderer) context.getRenderKit().getRenderer("org.primefaces.component", "org.primefaces.component.DataTableRenderer");
if(type.equals("header"))
renderer.encodeColumnHeader(context, table, column);
else if(type.equals("footer"))
renderer.encodeColumnFooter(context, table, column);
}