Search in sources :

Example 86 with FormComponent

use of com.qcadoo.view.api.components.FormComponent in project mes by qcadoo.

the class OperationGroupDetailsListeners method redirectToFilteredOperationGroupsList.

public void redirectToFilteredOperationGroupsList(final ViewDefinitionState view, final ComponentState componentState, final String[] args) {
    FormComponent operationGroupForm = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
    Entity operationGroup = operationGroupForm.getEntity();
    if (operationGroup.getId() == null) {
        return;
    }
    String operationGroupNumber = operationGroup.getStringField(NUMBER);
    Map<String, String> filters = Maps.newHashMap();
    filters.put("operationGroupNumber", operationGroupNumber);
    Map<String, Object> gridOptions = Maps.newHashMap();
    gridOptions.put(L_FILTERS, filters);
    Map<String, Object> parameters = Maps.newHashMap();
    parameters.put(L_GRID_OPTIONS, gridOptions);
    parameters.put(L_WINDOW_ACTIVE_MENU, "technology.operation");
    String url = "../page/technologies/operationsList.html";
    view.redirectTo(url, false, true, parameters);
}
Also used : FormComponent(com.qcadoo.view.api.components.FormComponent) Entity(com.qcadoo.model.api.Entity)

Example 87 with FormComponent

use of com.qcadoo.view.api.components.FormComponent in project mes by qcadoo.

the class OperationProductInComponentsImportListeners method processImportFile.

public void processImportFile(final ViewDefinitionState view, final ComponentState state, final String[] args) throws IOException {
    FormComponent technologyForm = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
    Entity technology = technologyForm.getEntity();
    technology = technology.getDataDefinition().save(technology);
    operationProductInComponentXlsxImportService.processImportFile(view, operationProductInComponentCellBinderRegistry.getCellBinderRegistry(), true, TechnologiesConstants.PLUGIN_IDENTIFIER, TechnologiesConstants.MODEL_OPERATION_PRODUCT_IN_COMPONENT, technology, OperationProductInComponentFields.TECHNOLOGY, OperationProductInComponentsImportListeners::createRestrictionForOperationProductInComponent);
}
Also used : FormComponent(com.qcadoo.view.api.components.FormComponent) Entity(com.qcadoo.model.api.Entity)

Example 88 with FormComponent

use of com.qcadoo.view.api.components.FormComponent in project mes by qcadoo.

the class ProductDetailsListenersT method addTechnologyGroup.

// TODO MAKU Fix passing values to another view
public final void addTechnologyGroup(final ViewDefinitionState view, final ComponentState componentState, final String[] args) {
    FormComponent productForm = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
    Entity product = productForm.getEntity();
    if (product.getId() == null) {
        return;
    }
    Map<String, Object> parameters = Maps.newHashMap();
    parameters.put(L_WINDOW_ACTIVE_MENU, "technology.technologyGroups");
    String url = "../page/technologies/technologyGroupDetails.html";
    view.redirectTo(url, false, true, parameters);
}
Also used : FormComponent(com.qcadoo.view.api.components.FormComponent) Entity(com.qcadoo.model.api.Entity)

Example 89 with FormComponent

use of com.qcadoo.view.api.components.FormComponent in project mes by qcadoo.

the class ProductDetailsListenersT method showProductGroupTechnologies.

public final void showProductGroupTechnologies(final ViewDefinitionState view, final ComponentState componentState, final String[] args) {
    FormComponent productForm = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
    Entity product = productForm.getEntity();
    if (product.getId() == null) {
        return;
    }
    Entity parent = product.getBelongsToField(ProductFields.PARENT);
    if (parent == null) {
        return;
    }
    String productNumber = parent.getStringField(NUMBER);
    Map<String, String> filters = Maps.newHashMap();
    filters.put("productNumber", applyInOperator(productNumber));
    Map<String, Object> gridOptions = Maps.newHashMap();
    gridOptions.put(L_FILTERS, filters);
    Map<String, Object> parameters = Maps.newHashMap();
    parameters.put(L_GRID_OPTIONS, gridOptions);
    parameters.put(L_WINDOW_ACTIVE_MENU, "technology.technologies");
    String url = "../page/technologies/technologiesList.html";
    view.redirectTo(url, false, true, parameters);
}
Also used : FormComponent(com.qcadoo.view.api.components.FormComponent) Entity(com.qcadoo.model.api.Entity)

Example 90 with FormComponent

use of com.qcadoo.view.api.components.FormComponent in project mes by qcadoo.

the class ProductDetailsListenersT method showTechnologiesWithFamilyProduct.

public final void showTechnologiesWithFamilyProduct(final ViewDefinitionState view, final ComponentState componentState, final String[] args) {
    FormComponent productForm = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
    Entity product = productForm.getEntity();
    if (product.getId() == null) {
        return;
    }
    Entity productDb = product.getDataDefinition().get(product.getId());
    Entity parent = productDb.getBelongsToField(ProductFields.PARENT);
    if (Objects.isNull(parent)) {
        return;
    }
    String productNumber = parent.getStringField(NUMBER);
    Map<String, String> filters = Maps.newHashMap();
    filters.put("productNumber", applyInOperator(productNumber));
    Map<String, Object> gridOptions = Maps.newHashMap();
    gridOptions.put(L_FILTERS, filters);
    Map<String, Object> parameters = Maps.newHashMap();
    parameters.put(L_GRID_OPTIONS, gridOptions);
    parameters.put(L_WINDOW_ACTIVE_MENU, "technology.technologies");
    String url = "../page/technologies/technologiesList.html";
    view.redirectTo(url, false, true, parameters);
}
Also used : FormComponent(com.qcadoo.view.api.components.FormComponent) Entity(com.qcadoo.model.api.Entity)

Aggregations

FormComponent (com.qcadoo.view.api.components.FormComponent)644 Entity (com.qcadoo.model.api.Entity)501 FieldComponent (com.qcadoo.view.api.components.FieldComponent)183 LookupComponent (com.qcadoo.view.api.components.LookupComponent)104 GridComponent (com.qcadoo.view.api.components.GridComponent)83 BigDecimal (java.math.BigDecimal)55 WindowComponent (com.qcadoo.view.api.components.WindowComponent)52 FilterValueHolder (com.qcadoo.view.api.components.lookup.FilterValueHolder)45 RibbonActionItem (com.qcadoo.view.api.ribbon.RibbonActionItem)42 CheckBoxComponent (com.qcadoo.view.api.components.CheckBoxComponent)39 RibbonGroup (com.qcadoo.view.api.ribbon.RibbonGroup)36 Date (java.util.Date)33 DataDefinition (com.qcadoo.model.api.DataDefinition)29 AwesomeDynamicListComponent (com.qcadoo.view.api.components.AwesomeDynamicListComponent)28 JSONObject (org.json.JSONObject)28 ComponentState (com.qcadoo.view.api.ComponentState)27 Transactional (org.springframework.transaction.annotation.Transactional)20 ViewDefinitionState (com.qcadoo.view.api.ViewDefinitionState)17 Optional (com.google.common.base.Optional)16 Ribbon (com.qcadoo.view.api.ribbon.Ribbon)16