diff --git a/src/main/java/br/ufpr/c3sl/estacaojuventude/web/OcorrenciaMunicipalController.java b/src/main/java/br/ufpr/c3sl/estacaojuventude/web/OcorrenciaMunicipalController.java index 9a4a9fd1501891600121ca96181fc22c13b0ad25..d91c4d88ee9504af2aec368de649f7726e895167 100644 --- a/src/main/java/br/ufpr/c3sl/estacaojuventude/web/OcorrenciaMunicipalController.java +++ b/src/main/java/br/ufpr/c3sl/estacaojuventude/web/OcorrenciaMunicipalController.java @@ -327,18 +327,18 @@ public class OcorrenciaMunicipalController { addDateTimeFormatPatterns(uiModel); uiModel.addAttribute("localizacaos", Localizacao.findAllLocalizacaos()); - List<Estado> le = Estado.findAllEstadoes(); - Estado e = new Estado(); - e.setNome(""); - le.add(0, e); - uiModel.addAttribute("estadoes", le); +// List<Estado> le = Estado.findAllEstadoes(); +// Estado e = new Estado(); +// e.setNome(""); +// le.add(0, e); +// uiModel.addAttribute("estadoes", le); -// List<Municipio> lm = Municipio.findAllMunicipios(); -// Municipio m = new Municipio(); -// m.setId((long) 0); -// m.setNome(""); -// lm.add(0, m); -// uiModel.addAttribute("municipios", lm); + List<Municipio> lm = Municipio.findAllMunicipios(); + Municipio m = new Municipio(); + m.setId((long) 0); + m.setNome(""); + lm.add(0, m); + uiModel.addAttribute("municipios", lm); if (ocorrenciaMunicipal.getOrgaosExecutores() != null) uiModel.addAttribute("orgaoexecutores", ocorrenciaMunicipal.getOrgaosExecutores()); diff --git a/src/main/webapp/WEB-INF/views/ocorrenciamunicipais/create.jspx b/src/main/webapp/WEB-INF/views/ocorrenciamunicipais/create.jspx index fb2d94e0bc166674a30e39293fc830d431ab47b8..9a9aedbab301495878b3eca572bff85d8b0c7bba 100644 --- a/src/main/webapp/WEB-INF/views/ocorrenciamunicipais/create.jspx +++ b/src/main/webapp/WEB-INF/views/ocorrenciamunicipais/create.jspx @@ -18,43 +18,43 @@ <field:select field="situacao" id="c_br_ufpr_c3sl_estacaojuventude_OcorrenciaMunicipal_situacao" items="${situacaos}" path="situacaos" widthcss="60px" z="user-managed"/> <field:textarea field="observacao" id="c_br_ufpr_c3sl_estacaojuventude_OcorrenciaMunicipal_observacao" z="user-managed"/> - <field:select field="uf" id="c_br_ufpr_c3sl_estacaojuventude_Municipio_uf" itemValue="id" items="${estadoes}" path="/estados" z="user-managed" disableFormBinding="true" /> + <!-- <field:select field="uf" id="c_br_ufpr_c3sl_estacaojuventude_Municipio_uf" itemValue="id" items="${estadoes}" path="/estados" z="user-managed" disableFormBinding="true" /> --> <field:select field="municipios" id="c_br_ufpr_c3sl_estacaojuventude_OcorrenciaMunicipal_municipios" itemValue="id" items="${municipios}" multiple="true" path="/municipios" z="BD05YnRdtdU25XgKJrSAq3Mc+f4="/> </form:create> <form:dependency dependencies="${dependencies}" id="d_br_ufpr_c3sl_estacaojuventude_OcorrenciaMunicipal" render="${not empty dependencies}" z="ame9911g+go04TVYVVTrRJK0UOs="/> - <script type="text/javascript"> +<!-- <script type="text/javascript"> --> - Spring.addDecoration(new Spring.ElementDecoration({ - elementId : '_uf_id', - widgetType : "dijit.form.FilteringSelect", - widgetAttrs : { - onChange : function() { +// Spring.addDecoration(new Spring.ElementDecoration({ +// elementId : '_uf_id', +// widgetType : "dijit.form.FilteringSelect", +// widgetAttrs : { +// onChange : function() { - //ID of the chosen "estado" - uf=document.getElementsByName("uf")[0].value; +// //ID of the chosen "estado" +// uf=document.getElementsByName("uf")[0].value; - //Create and send to server a request of - //the list of "Municipios" that belongs to the "Estado" chosen - xmlhttp = new XMLHttpRequest(); - xmlhttp.open("GET", "ocorrenciamunicipais/"+uf ,false); - xmlhttp.send(); +// //Create and send to server a request of +// //the list of "Municipios" that belongs to the "Estado" chosen +// xmlhttp = new XMLHttpRequest(); +// xmlhttp.open("GET", "ocorrenciamunicipais/"+uf ,false); +// xmlhttp.send(); - //Create a temporary html document to store the html code - //sent by the server containing the list of "Municipios" - var responseDoc = document.implementation.createHTMLDocument("XMLHttpResponse"); - responseDoc.documentElement.innerHTML = xmlhttp.responseText; +// //Create a temporary html document to store the html code +// //sent by the server containing the list of "Municipios" +// var responseDoc = document.implementation.createHTMLDocument("XMLHttpResponse"); +// responseDoc.documentElement.innerHTML = xmlhttp.responseText; - //Copy the list of the response to the real page - var PageElem = document.getElementById("_c_br_ufpr_c3sl_estacaojuventude_OcorrenciaMunicipal_municipios_id"); - var RespElem = responseDoc.getElementById("_c_br_ufpr_c3sl_estacaojuventude_OcorrenciaMunicipal_municipios_id"); - PageElem.innerHTML = RespElem.innerHTML; - } - } - })); +// //Copy the list of the response to the real page +// var PageElem = document.getElementById("_c_br_ufpr_c3sl_estacaojuventude_OcorrenciaMunicipal_municipios_id"); +// var RespElem = responseDoc.getElementById("_c_br_ufpr_c3sl_estacaojuventude_OcorrenciaMunicipal_municipios_id"); +// PageElem.innerHTML = RespElem.innerHTML; +// } +// } +// })); - </script> +<!-- </script> --> </div>