use of com.qcadoo.view.api.components.GridComponent in project mes by qcadoo.
the class OrdersPlanningListListenersWP method workPlanDelivered.
public final void workPlanDelivered(final ViewDefinitionState view, final ComponentState state, final String[] args) {
GridComponent ordersGrid = (GridComponent) state;
workPlanService.workPlanDelivered(state, ordersGrid.getSelectedEntities());
}
use of com.qcadoo.view.api.components.GridComponent in project mes by qcadoo.
the class WagesListsHooks 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) {
Entity ownerCompany = companyService.getCompany();
searchBuilder.add(SearchRestrictions.or(SearchRestrictions.belongsTo("workFor", ownerCompany), SearchRestrictions.isNotNull("laborHourlyCost")));
}
});
}
use of com.qcadoo.view.api.components.GridComponent in project mes by qcadoo.
the class WorkPlansListView method from.
public static WorkPlansListView from(final ViewDefinitionState view) {
WindowComponent window = (WindowComponent) view.getComponentByReference(QcadooViewConstants.L_WINDOW);
GridComponent grid = (GridComponent) view.getComponentByReference(QcadooViewConstants.L_GRID);
RibbonActionItem deleteButton = window.getRibbon().getGroupByName("actions").getItemByName("delete");
return new WorkPlansListView(window, deleteButton, grid);
}
use of com.qcadoo.view.api.components.GridComponent in project mes by qcadoo.
the class ProductService method getDefaultConversionsForGrid.
public void getDefaultConversionsForGrid(final ViewDefinitionState view, final ComponentState state, final String[] args) {
GridComponent productsGrid = (GridComponent) view.getComponentByReference(QcadooViewConstants.L_GRID);
if (productsGrid.getSelectedEntities().isEmpty()) {
return;
}
final List<Entity> products = productsGrid.getSelectedEntities();
for (Entity product : products) {
conversionForProductUnit(product);
product.getDataDefinition().save(product);
}
productsGrid.addMessage("basic.productsList.message.getDefaultConversionsForProductsSuccess", MessageType.SUCCESS);
}
use of com.qcadoo.view.api.components.GridComponent in project mes by qcadoo.
the class BasicProductionCountingDetailsHooks method setFieldEditableDependsOfOrderState.
private void setFieldEditableDependsOfOrderState(final ViewDefinitionState view) {
FormComponent form = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
GridComponent grid = (GridComponent) view.getComponentByReference(L_GRID);
Long formId = form.getEntityId();
if (formId == null) {
return;
}
Entity basicProductionCounting = form.getEntity();
if (disableGrid(orderService.getOrder(basicProductionCounting.getBelongsToField(BasicProductionCountingFields.ORDER).getId()))) {
grid.setEnabled(false);
} else {
boolean isLocked = progressModifyLockHelper.isLocked(orderService.getOrder(basicProductionCounting.getBelongsToField(BasicProductionCountingFields.ORDER).getId()));
grid.setEnabled(!isLocked);
}
}
Aggregations