use of org.springframework.web.servlet.ModelAndView in project head by mifos.
the class DefineNewFundController method showPopulatedForm.
@RequestMapping(method = RequestMethod.GET)
public ModelAndView showPopulatedForm() {
ModelAndView modelAndView = new ModelAndView();
FundFormBean bean = new FundFormBean();
modelAndView.setViewName("defineNewFund");
modelAndView.addObject("formBean", bean);
Map<String, String> codeMap = retrieveFundCodeOptionMap();
modelAndView.addObject("code", codeMap);
return modelAndView;
}
use of org.springframework.web.servlet.ModelAndView in project head by mifos.
the class DefineNewFundController method showPreview.
@RequestMapping(method = RequestMethod.POST)
public ModelAndView showPreview(@RequestParam(value = CANCEL_PARAM, required = false) String cancel, @ModelAttribute("formBean") @Valid FundFormBean formBean, BindingResult result, SessionStatus status) {
ModelAndView modelAndView = new ModelAndView(REDIRECT_TO_ADMIN_SCREEN);
if (StringUtils.isNotBlank(cancel)) {
modelAndView.setViewName(REDIRECT_TO_ADMIN_SCREEN);
status.setComplete();
} else if (result.hasErrors()) {
modelAndView.setViewName("defineNewFund");
Map<String, String> codeMap = retrieveFundCodeOptionMap();
modelAndView.addObject("code", codeMap);
} else {
modelAndView.setViewName("newFundPreview");
Map<String, String> codeMap = retrieveFundCodeOptionMap();
formBean.setCodeValue(codeMap.get(formBean.getCodeId()));
modelAndView.addObject("formBean", formBean);
}
return modelAndView;
}
use of org.springframework.web.servlet.ModelAndView in project head by mifos.
the class DefineNewOfficeController method populateForm.
@RequestMapping(method = RequestMethod.GET)
public ModelAndView populateForm(HttpServletRequest request, OfficeFormBean officeFormBean) {
ModelAndView modelAndView = new ModelAndView("defineNewOffice");
EditOfficeInformationController editOfficeInformationController = new EditOfficeInformationController(officeServiceFacade);
if (StringUtils.isNotBlank(request.getParameter("levelId"))) {
officeFormBean.setLevelId(request.getParameter("levelId"));
}
officeFormBean.setName("");
officeFormBean.setLevelId("");
officeFormBean.setOfficeShortName("");
modelAndView.addObject("officeTypes", editOfficeInformationController.getOfficeTypes("new"));
modelAndView.addObject("showError", "false");
modelAndView.addObject("officeFormBean", officeFormBean);
return modelAndView;
}
use of org.springframework.web.servlet.ModelAndView in project head by mifos.
the class DefineNewPenaltyController method showForm.
@RequestMapping(method = RequestMethod.GET)
public ModelAndView showForm() {
ModelAndView modelAndView = new ModelAndView("defineNewPenalty");
PenaltyFormBean bean = new PenaltyFormBean();
parametersDto = this.penaltyServiceFacade.getPenaltyParameters();
configurationDto = this.configurationServiceFacade.getAccountingConfiguration();
modelAndView.addObject("formBean", bean);
modelAndView.addObject("param", parametersDto);
modelAndView.addObject("GLCodeMode", configurationDto.getGlCodeMode());
return modelAndView;
}
use of org.springframework.web.servlet.ModelAndView in project head by mifos.
the class DashboardDetailsController method showBadStandingLoansDBDetails.
@RequestMapping(value = "/viewBadStandingLoansDBDetails", method = RequestMethod.GET)
public ModelAndView showBadStandingLoansDBDetails(HttpServletRequest request, HttpServletResponse response) {
ModelAndView modelAndView = getLoanModelAndView();
List<DashboardDetailDto> loans = (List<DashboardDetailDto>) dashboardServiceFacade.getLoansInArrears(0, 10, null);
modelAndView.addObject("totalSize", dashboardServiceFacade.countBadStandingLoans());
modelAndView.addObject("dashboardDetails", loans);
modelAndView.addObject("ajaxUrl", "badStandingLoansDBDetailsAjax.ftl");
return modelAndView;
}
Aggregations