Skip to content
Snippets Groups Projects
Commit d1914376 authored by Fabiano Sluzarski's avatar Fabiano Sluzarski
Browse files

adicionado componete de multipla selecao funcionando na tela de update

parent c3753b31
Branches
Tags
No related merge requests found
...@@ -70,12 +70,18 @@ public class OcorrenciaMunicipalController { ...@@ -70,12 +70,18 @@ public class OcorrenciaMunicipalController {
ocorrenciaMunicipalGlobal.setOrgaosExecutores(orgaosExecutoresNovo); ocorrenciaMunicipalGlobal.setOrgaosExecutores(orgaosExecutoresNovo);
} }
populateEditForm(uiModel, ocorrenciaMunicipalGlobal); populateEditForm(uiModel, ocorrenciaMunicipalGlobal);
if (ocorrenciaMunicipalGlobal.getId() == null) {
ocorrenciaMunicipalGlobal = null; ocorrenciaMunicipalGlobal = null;
return "ocorrenciamunicipais/create"; return "ocorrenciamunicipais/create";
} }
else {
ocorrenciaMunicipalGlobal = null;
return "ocorrenciamunicipais/update";
}
}
@RequestMapping(value = "selecionar", method = RequestMethod.POST, produces = "text/html") @RequestMapping(value = "selecionar", method = {RequestMethod.POST, RequestMethod.PUT}, produces = "text/html")
public String createSelectForm(@Valid OcorrenciaMunicipal ocorrenciaMunicipal, @RequestParam(value = "tipo", required = false) String type, @RequestParam(value = "op", required = false) Integer op, BindingResult bindingResult, Model uiModel, HttpServletRequest httpServletRequest) { public String selectForm(@Valid OcorrenciaMunicipal ocorrenciaMunicipal, @RequestParam(value = "tipo", required = false) String type, @RequestParam(value = "op", required = false) Integer op, BindingResult bindingResult, Model uiModel, HttpServletRequest httpServletRequest) {
ocorrenciaMunicipalGlobal = ocorrenciaMunicipal; ocorrenciaMunicipalGlobal = ocorrenciaMunicipal;
if (op == 0) { if (op == 0) {
......
...@@ -101,11 +101,17 @@ public class ProgramaController { ...@@ -101,11 +101,17 @@ public class ProgramaController {
programaGlobal.setOrgaosExecutores(orgaosExecutoresNovo); programaGlobal.setOrgaosExecutores(orgaosExecutoresNovo);
} }
populateEditForm(uiModel, programaGlobal); populateEditForm(uiModel, programaGlobal);
if (programaGlobal.getId() == null) {
programaGlobal = null; programaGlobal = null;
return "programas/create"; return "programas/create";
} }
else {
programaGlobal = null;
return "programas/update";
}
}
@RequestMapping(value = "selecionar", method = RequestMethod.POST, produces = "text/html") @RequestMapping(value = "selecionar", method = {RequestMethod.POST, RequestMethod.PUT}, produces = "text/html")
public String createSelectForm(@Valid Programa programa, @RequestParam(value = "tipo", required = false) String type, @RequestParam(value = "op", required = false) Integer op, BindingResult bindingResult, Model uiModel, HttpServletRequest httpServletRequest) { public String createSelectForm(@Valid Programa programa, @RequestParam(value = "tipo", required = false) String type, @RequestParam(value = "op", required = false) Integer op, BindingResult bindingResult, Model uiModel, HttpServletRequest httpServletRequest) {
programaGlobal = programa; programaGlobal = programa;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment