Row headerRow = (Row) child;
if(headerRow.isRendered()) {
for(UIComponent headerRowChild : headerRow.getChildren()) {
if(headerRowChild instanceof Column) {
Column column = (Column) headerRowChild;
if(column.isRendered()) {
ValueExpression columnFilterByVE = column.getValueExpression("filterBy");
if(columnFilterByVE != null) {
ValueExpression filterByVE = columnFilterByVE;
UIComponent filterFacet = column.getFacet("filter");
Object filterValue;
if(filterFacet == null)
filterValue = params.get(column.getClientId(context) + separator + "filter");
else
filterValue = ((ValueHolder) filterFacet).getLocalValue();
filterMetadata.add(new FilterMeta(column, filterByVE, filterValue));
}
}
}
else if(headerRowChild instanceof Columns) {
Columns uiColumns = (Columns) headerRowChild;
String uiColumnsClientId = uiColumns.getClientId(context);
for(int i=0; i < uiColumns.getRowCount(); i++) {
DynamicColumn dynaColumn = new DynamicColumn(i, uiColumns);
dynaColumn.setColumnKey(uiColumnsClientId + separator + i);
dynaColumn.applyStatelessModel();
ValueExpression columnFilterByVE = dynaColumn.getValueExpression("filterBy");
if(columnFilterByVE != null) {
Object filterValue = null;
String filterId = dynaColumn.getContainerClientId(context) + separator + "filter";
UIComponent filterFacet = dynaColumn.getFacet("filter");
if(filterFacet == null)
filterValue = params.get(filterId);
else
filterValue = ((ValueHolder) filterFacet).getLocalValue();
filterMetadata.add(new FilterMeta(dynaColumn, columnFilterByVE, filterValue));
}
}
}
}
}
}
}
else {
for(UIColumn column : table.getColumns()) {
ValueExpression columnFilterByVE = column.getValueExpression("filterBy");
if (columnFilterByVE != null) {
UIComponent filterFacet = column.getFacet("filter");
ValueExpression filterByVE = columnFilterByVE;
Object filterValue = null;
String filterId = null;
if(column instanceof Column) {
filterId = column.getClientId(context) + separator + "filter";
}
else if(column instanceof DynamicColumn) {
DynamicColumn dynamicColumn = (DynamicColumn) column;
dynamicColumn.applyStatelessModel();
filterId = dynamicColumn.getContainerClientId(context) + separator + "filter";