Search in sources :

Example 1 with DenyingClause

use of com.haulmont.cuba.core.global.filter.DenyingClause in project cuba by cuba-platform.

the class FilterDelegateImpl method setDatasource.

@Override
public void setDatasource(CollectionDatasource datasource) {
    this.datasource = datasource;
    this.dsQueryFilter = datasource.getQueryFilter();
    if (getResultingManualApplyRequired()) {
        // set initial denying condition to get empty datasource before explicit filter applying
        QueryFilter queryFilter = new QueryFilter(new DenyingClause());
        if (dsQueryFilter != null) {
            queryFilter = QueryFilter.merge(dsQueryFilter, queryFilter);
        }
        datasource.setQueryFilter(queryFilter);
    }
    if (datasource instanceof CollectionDatasource.Lazy || datasource instanceof HierarchicalDatasource) {
        setUseMaxResults(false);
    } else if (useMaxResults) {
        initMaxResults();
    }
    if (ftsSwitch != null && !isEntityAvailableForFts()) {
        controlsLayout.remove(ftsSwitch);
    }
}
Also used : QueryFilter(com.haulmont.cuba.core.global.filter.QueryFilter) HierarchicalDatasource(com.haulmont.cuba.gui.data.HierarchicalDatasource) CollectionDatasource(com.haulmont.cuba.gui.data.CollectionDatasource) DenyingClause(com.haulmont.cuba.core.global.filter.DenyingClause)

Aggregations

DenyingClause (com.haulmont.cuba.core.global.filter.DenyingClause)1 QueryFilter (com.haulmont.cuba.core.global.filter.QueryFilter)1 CollectionDatasource (com.haulmont.cuba.gui.data.CollectionDatasource)1 HierarchicalDatasource (com.haulmont.cuba.gui.data.HierarchicalDatasource)1