use of com.qcadoo.model.api.search.CustomRestriction in project mes by qcadoo.
the class MaterialRequirementCoveragesListHooks method addDiscriminatorRestrictionToGrid.
public final void addDiscriminatorRestrictionToGrid(final ViewDefinitionState view) {
GridComponent grid = (GridComponent) view.getComponentByReference(QcadooViewConstants.L_GRID);
grid.setCustomRestriction(new CustomRestriction() {
@Override
public void addRestriction(final SearchCriteriaBuilder searchBuilder) {
searchBuilder.add(SearchRestrictions.eq(MaterialRequirementCoverageFields.SAVED, true));
}
});
}
use of com.qcadoo.model.api.search.CustomRestriction in project mes by qcadoo.
the class BatchViewHooks method filterStateChangeHistory.
private void filterStateChangeHistory(final ViewDefinitionState view) {
GridComponent loggingsGrid = (GridComponent) view.getComponentByReference(L_LOGGINGS_GRID);
CustomRestriction onlySuccessfulRestriction = stateChangeHistoryService.buildStatusRestriction(BatchStateChangeFields.STATUS, Lists.newArrayList(SUCCESSFUL.getStringValue()));
loggingsGrid.setCustomRestriction(onlySuccessfulRestriction);
}
use of com.qcadoo.model.api.search.CustomRestriction in project mes by qcadoo.
the class TrackingRecordSimpleViewHooks method filterStateChangeHistory.
public void filterStateChangeHistory(final ViewDefinitionState view) {
final GridComponent historyGrid = (GridComponent) view.getComponentByReference(L_LOGGINGS_GRID);
final CustomRestriction onlySuccessfulRestriction = stateChangeHistoryService.buildStatusRestriction(TrackingRecordStateChangeFields.STATUS, Lists.newArrayList(SUCCESSFUL.getStringValue()));
historyGrid.setCustomRestriction(onlySuccessfulRestriction);
}
use of com.qcadoo.model.api.search.CustomRestriction in project mes by qcadoo.
the class OrderDetailsHooks method filterStateChangeHistory.
// FIXME replace this beforeRender hook with <criteriaModifier /> parameter in view XML.
public void filterStateChangeHistory(final ViewDefinitionState view) {
final GridComponent historyGrid = (GridComponent) view.getComponentByReference(QcadooViewConstants.L_GRID);
final CustomRestriction onlySuccessfulRestriction = stateChangeHistoryService.buildStatusRestriction(OrderStateChangeFields.STATUS, Lists.newArrayList(StateChangeStatus.SUCCESSFUL.getStringValue()));
historyGrid.setCustomRestriction(onlySuccessfulRestriction);
}
use of com.qcadoo.model.api.search.CustomRestriction in project mes by qcadoo.
the class RequestForQuotationDetailsHooks method filterStateChangeHistory.
public void filterStateChangeHistory(final ViewDefinitionState view) {
final GridComponent historyGrid = (GridComponent) view.getComponentByReference("loggingsGrid");
final CustomRestriction onlySuccessfulRestriction = stateChangeHistoryService.buildStatusRestriction(RequestForQuotationStateChangeFields.STATUS, Lists.newArrayList(SUCCESSFUL.getStringValue()));
historyGrid.setCustomRestriction(onlySuccessfulRestriction);
}
Aggregations