use of com.qcadoo.view.api.components.FormComponent in project mes by qcadoo.
the class NegotiationDetailsHooks method changeFieldsEnabled.
private void changeFieldsEnabled(final ViewDefinitionState view, final boolean enabledForm, final boolean enabledGrid) {
FormComponent negotiationForm = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
GridComponent negotiationProducts = (GridComponent) view.getComponentByReference(NEGOTIATION_PRODUCTS);
negotiationForm.setFormEnabled(enabledForm);
negotiationProducts.setEnabled(enabledGrid);
negotiationProducts.setEditable(enabledGrid);
}
use of com.qcadoo.view.api.components.FormComponent in project mes by qcadoo.
the class NegotiationDetailsHooks method changeFieldsEnabledDependOnState.
public void changeFieldsEnabledDependOnState(final ViewDefinitionState view) {
FormComponent negotiationForm = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
FieldComponent stateField = (FieldComponent) view.getComponentByReference(STATE);
String state = stateField.getFieldValue().toString();
if (negotiationForm.getEntityId() == null) {
changeFieldsEnabled(view, true, false);
} else {
if (COMPLETED.equals(state) || DECLINED.equals(state) || GENERATED_REQUESTS.equals(state)) {
changeFieldsEnabled(view, false, false);
} else {
changeFieldsEnabled(view, true, true);
}
}
}
use of com.qcadoo.view.api.components.FormComponent in project mes by qcadoo.
the class CompanyDetailsListenersSN method redirectToFilteredOffersList.
public void redirectToFilteredOffersList(final ViewDefinitionState view, final ComponentState componentState, final String[] args) {
FormComponent companyForm = (FormComponent) view.getComponentByReference(QcadooViewConstants.L_FORM);
Entity company = companyForm.getEntity();
if (company.getId() == null) {
return;
}
String supplierName = company.getStringField("name");
Map<String, String> filters = Maps.newHashMap();
filters.put("supplierName", supplierName);
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.offer");
String url = "../page/supplyNegotiations/offersList.html";
view.redirectTo(url, false, true, parameters);
}
use of com.qcadoo.view.api.components.FormComponent in project mes by qcadoo.
the class NegotiationDetailsListeners method showOffersForGivenNegotiation.
public final void showOffersForGivenNegotiation(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.offer");
String url = "../page/supplyNegotiations/offersList.html";
view.redirectTo(url, false, true, parameters);
}
use of com.qcadoo.view.api.components.FormComponent in project mes by qcadoo.
the class NegotiationDetailsListeners method showRequestForQuotationsForGivenNegotiation.
public final void showRequestForQuotationsForGivenNegotiation(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.requestsForQuotation");
String url = "../page/supplyNegotiations/requestForQuotationsList.html";
view.redirectTo(url, false, true, parameters);
}
Aggregations