Search in sources :

Example 16 with CustomRestriction

use of com.qcadoo.model.api.search.CustomRestriction in project qcadoo by qcadoo.

the class ViewDictionaryService method addRestrictionToDictionariesGrid.

public void addRestrictionToDictionariesGrid(final ViewDefinitionState viewDefinitionState) {
    GridComponent grid = (GridComponent) viewDefinitionState.getComponentByReference(QcadooViewConstants.L_GRID);
    grid.setCustomRestriction(new CustomRestriction() {

        @Override
        public void addRestriction(final SearchCriteriaBuilder searchCriteriaBuilder) {
            searchCriteriaBuilder.add(SearchRestrictions.eq("active", true));
        }
    });
}
Also used : SearchCriteriaBuilder(com.qcadoo.model.api.search.SearchCriteriaBuilder) GridComponent(com.qcadoo.view.api.components.GridComponent) CustomRestriction(com.qcadoo.model.api.search.CustomRestriction)

Aggregations

CustomRestriction (com.qcadoo.model.api.search.CustomRestriction)16 GridComponent (com.qcadoo.view.api.components.GridComponent)12 SearchCriteriaBuilder (com.qcadoo.model.api.search.SearchCriteriaBuilder)8 Entity (com.qcadoo.model.api.Entity)1 SearchDisjunction (com.qcadoo.model.api.search.SearchDisjunction)1 PossibleUnitConversions (com.qcadoo.model.api.units.PossibleUnitConversions)1 FieldComponent (com.qcadoo.view.api.components.FieldComponent)1 Transactional (org.springframework.transaction.annotation.Transactional)1