Skip to content
Snippets Groups Projects
Commit 75416ac3 authored by Bruno Nocera Zanette's avatar Bruno Nocera Zanette
Browse files

Disable Estado-Municipio options to O.Municipais

Disable Estado-Municipio options to O.Municipais
parent 064963c3
Branches
No related tags found
No related merge requests found
......@@ -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<Municipio> lm = Municipio.findAllMunicipios();
// Municipio m = new Municipio();
// m.setId((long) 0);
// m.setNome("");
// lm.add(0, m);
// uiModel.addAttribute("municipios", lm);
// 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);
if (ocorrenciaMunicipal.getOrgaosExecutores() != null)
uiModel.addAttribute("orgaoexecutores", ocorrenciaMunicipal.getOrgaosExecutores());
......
......@@ -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">
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;
//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;
//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 type="text/javascript"> -->
// 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;
// //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;
// //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> -->
</div>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment