use of org.springframework.web.bind.annotation.ModelAttribute in project head by mifos.
the class EditProductMixController method showEditForm.
@RequestMapping(method = RequestMethod.GET)
@ModelAttribute("formBean")
public ProductMixFormBean showEditForm(@RequestParam(value = "productId", required = true) Integer productId) {
List<ProductTypeDto> productTypes = this.adminServiceFacade.retrieveProductTypesApplicableToProductMix();
ProductMixFormBean formBean = productMixAssembler.createFormBean(productTypes);
formBean.setProductId(productId.toString());
formBean.setProductTypeId("1");
ProductMixDetailsDto productMixDetails = adminServiceFacade.retrieveProductMixDetails(productId.shortValue(), formBean.getProductTypeId());
Map<String, String> productNameOptions = new LinkedHashMap<String, String>();
productNameOptions.put(productMixDetails.getPrdOfferingId().toString(), productMixDetails.getPrdOfferingName());
formBean.setProductNameOptions(productNameOptions);
populateAllowedNotAllowedOptions(formBean, productMixDetails);
return formBean;
}
use of org.springframework.web.bind.annotation.ModelAttribute in project head by mifos.
the class LatenessDormancyController method showPopulatedForm.
@RequestMapping(method = RequestMethod.GET)
@ModelAttribute("formBean")
public LatenessDormancyFormBean showPopulatedForm() {
ProductConfigurationDto productConfiguration = adminServiceFacade.retrieveProductConfiguration();
LatenessDormancyFormBean formBean = new LatenessDormancyFormBean();
formBean.setLatenessDays(productConfiguration.getLatenessDays());
formBean.setDormancyDays(productConfiguration.getDormancyDays());
return formBean;
}
use of org.springframework.web.bind.annotation.ModelAttribute in project head by mifos.
the class SavingsProductChangeLogController method showAllAuditLogsForSavingsProducts.
@ModelAttribute("auditLog")
@RequestMapping(method = RequestMethod.GET)
public AuditLogScreenDto showAllAuditLogsForSavingsProducts(@RequestParam(value = "productId", required = true) Integer productId) {
SavingsProductDto productDetails = adminServiceFacade.retrieveSavingsProductDetails(productId);
List<AuditLogDto> auditLogRecords = adminServiceFacade.retrieveSavingsProductAuditLogs(productId);
return new AuditLogScreenDto(productDetails.getProductDetails().getId(), productDetails.getProductDetails().getName(), productDetails.getProductDetails().getCreatedDateFormatted(), auditLogRecords);
}
use of org.springframework.web.bind.annotation.ModelAttribute in project head by mifos.
the class DeleteCoaController method showForm.
@ModelAttribute("formBean")
@RequestMapping(method = RequestMethod.GET)
public CoaFormBean showForm(@RequestParam(value = "id", required = true) Short id) {
CoaDto coaDto = coaServiceFacade.getCoaDTO(id);
CoaFormBean formBean = new CoaFormBean();
formBean.setCoaName(coaDto.getAccountName());
formBean.setGlCode(coaDto.getGlCodeString());
formBean.setAccountId(id);
return formBean;
}
use of org.springframework.web.bind.annotation.ModelAttribute in project head by mifos.
the class MonthClosingController method showPopulatedForm.
@ModelAttribute("monthClosingFormBean")
public MonthClosingFormBean showPopulatedForm() {
MonthClosingFormBean formBean = new MonthClosingFormBean();
Date monthClosingDateToSet = monthClosingServiceFacade.getMonthClosingDate();
if (monthClosingDateToSet == null) {
monthClosingDateToSet = new DateTime().toDate();
}
formBean.setDate(new DateTime(monthClosingDateToSet));
formBean.setLocale(Locale.getDefault());
return formBean;
}
Aggregations