use of com.qcadoo.view.api.components.FormComponent in project mes by qcadoo.
the class NegotiationDetailsListeners method showOffersItemsForGivenNegotiation.
public final void showOffersItemsForGivenNegotiation(final ViewDefinitionState view, final ComponentState state, final String[] args) {
FormComponent negotiationForm = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
Entity negotiation = negotiationForm.getEntity();
if (negotiation.getId() == null) {
return;
}
String negotiationNumber = negotiation.getStringField(NUMBER);
if (negotiationNumber == null) {
return;
}
Map<String, String> filters = Maps.newHashMap();
filters.put(L_NEGOTIATION_NUMBER, negotiationNumber);
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, "requirements.offersItems");
String url = "../page/supplyNegotiations/offersItems.html";
view.redirectTo(url, false, true, parameters);
}
use of com.qcadoo.view.api.components.FormComponent in project mes by qcadoo.
the class ProductionTrackingDetailsHooksTSFPC method disabledSubcontractorFieldForState.
public void disabledSubcontractorFieldForState(final ViewDefinitionState view) {
FormComponent productionTrackingForm = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
LookupComponent subcontractorLookup = (LookupComponent) view.getComponentByReference(ProductionTrackingFieldsTSFPC.SUBCONTRACTOR);
if (productionTrackingForm.getEntityId() == null) {
return;
}
Entity productionTracking = getProductionTrackingFromDB(productionTrackingForm.getEntityId());
String state = productionTracking.getStringField(ProductionTrackingFields.STATE);
boolean isDraft = ProductionTrackingStateStringValues.DRAFT.equals(state);
boolean isExternalSynchronized = productionTracking.getBooleanField(ProductionTrackingFields.IS_EXTERNAL_SYNCHRONIZED);
subcontractorLookup.setEnabled(isDraft && isExternalSynchronized);
}
use of com.qcadoo.view.api.components.FormComponent in project mes by qcadoo.
the class MaterialRequirementDetailsHooksTS method setMrpAlgoritmValue.
public void setMrpAlgoritmValue(final ViewDefinitionState view) {
FormComponent form = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
if (form.getEntityId() != null) {
return;
}
FieldComponent mrpAlgoritm = (FieldComponent) view.getComponentByReference("mrpAlgorithm");
mrpAlgoritm.setFieldValue(COMPONENTS_AND_SUBCONTRACTORS_PRODUCTS.getStringValue());
mrpAlgoritm.requestComponentUpdateState();
}
use of com.qcadoo.view.api.components.FormComponent in project mes by qcadoo.
the class TechnologyService method setLookupDisableInTechnologyOperationComponent.
public void setLookupDisableInTechnologyOperationComponent(final ViewDefinitionState view) {
FormComponent form = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
FieldComponent operationLookup = (FieldComponent) view.getComponentByReference(L_OPERATION);
operationLookup.setEnabled(Objects.isNull(form.getEntityId()));
}
use of com.qcadoo.view.api.components.FormComponent in project mes by qcadoo.
the class TechnologyTreeNumberingHooks method rebuildTreeNumbering.
public void rebuildTreeNumbering(final ViewDefinitionState view) {
FormComponent form = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
Long technologyId = form.getEntityId();
if (technologyId == null) {
return;
}
Entity technology = getTechnologyById(technologyId);
if (!isDraftTechnology(technology)) {
return;
}
EntityTree technologyTree = technology.getTreeField(TechnologyFields.OPERATION_COMPONENTS);
if (technologyTree == null || technologyTree.getRoot() == null) {
return;
}
debug("Fire tree node number generator for tecnology with id = " + technologyId);
treeNumberingService.generateTreeNumbers(technologyTree);
}
Aggregations