Skip to content
Snippets Groups Projects
Commit 2b73dedf authored by Daniel Vitor Ruiz's avatar Daniel Vitor Ruiz
Browse files

Fixed remove icon on popup

parent 2218110b
No related branches found
No related tags found
No related merge requests found
......@@ -146,6 +146,7 @@ public class OcorrenciaMunicipalController {
}
if (op == 0) {
uiModel.addAttribute("remover", false);
if (type.equals("orgaosExecutores")) {
if (ocorrenciaMunicipal.getOrgaosExecutores() == null)
uiModel.addAttribute("orgaoexecutors", OrgaoExecutor.findAllOrgaoExecutors());
......@@ -184,6 +185,7 @@ public class OcorrenciaMunicipalController {
}
}
else if (op == 1) {
uiModel.addAttribute("remover", true);
if (type.equals("orgaosExecutores")) {
if (ocorrenciaMunicipal.getOrgaosExecutores() != null) {
uiModel.addAttribute("orgaoexecutors", ocorrenciaMunicipal.getOrgaosExecutores());
......
......@@ -158,6 +158,7 @@ public class ProgramaController {
}
if (op == 0) {
uiModel.addAttribute("remover", false);
if (type.equals("tematicas")) {
if (programa.getTematicas() == null){
uiModel.addAttribute("tematicas", Tematica.findAllTematicas());
......@@ -197,6 +198,7 @@ public class ProgramaController {
}
}
else if (op == 1) {
uiModel.addAttribute("remover", true);
if (type.equals("tematicas")) {
if (programa.getTematicas() != null) {
uiModel.addAttribute("tematicas", programa.getTematicas());
......@@ -423,8 +425,10 @@ public class ProgramaController {
public String selectSearchForm(@Valid Programa programa, @RequestParam(value = "tipo", required = false) String type, @RequestParam(value = "op", required = false) Integer op, BindingResult bindingResult, Model uiModel, HttpServletRequest httpServletRequest) {
if (op == null)
return searchProgramas(programa, uiModel);
programaGlobal = programa;
if (op == 0) {
uiModel.addAttribute("remover", false);
if (type.equals("tematicas")) {
if (programa.getTematicas() == null)
uiModel.addAttribute("tematicas", Tematica.findAllTematicas());
......@@ -444,6 +448,7 @@ public class ProgramaController {
}
}
else if (op == 1) {
uiModel.addAttribute("remover", true);
if (type.equals("tematicas")) {
if (programa.getTematicas() != null) {
uiModel.addAttribute("tematicas", programa.getTematicas());
......
......@@ -12,6 +12,7 @@
<jsp:directive.attribute name="render" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Indicate if the contents of this tag and all enclosed tags should be rendered (default 'true')" />
<jsp:directive.attribute name="z" type="java.lang.String" required="false" description="Used for checking if element has been modified (to recalculate simply provide empty string value)" />
<jsp:directive.attribute name="remover" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Test if it's a remove or add operation" />
<jsp:directive.attribute name="select" type="java.lang.Boolean" required="false" rtexprvalue="true" description="Include link to select, used for the multiple select." />
<jsp:directive.attribute name="pathShow" type="java.lang.String" required="false" rtexprvalue="true" description="Specify the show button URL path. (used only with select)" />
......@@ -162,24 +163,20 @@
</c:if>
<c:if test="${select}">
<c:choose>
<c:when test="${remover}">
<spring:url value="/resources/images/delete.png" var="remove_image_url" />
<spring:message arguments="${typeName}" code="entity_update" var="update_label" htmlEscape="false" />
<input id="continuar" style="background:url(${remove_image_url}) no-repeat; width:19px;"
type="submit" value="continuar" onclick="post()"/>
</c:when>
<c:otherwise>
<spring:url value="/resources/images/add.png" var="add_image_url" />
<spring:message arguments="${typeName}" code="entity_update" var="update_label" htmlEscape="false" />
<input id="continuar" style="background:url(${add_image_url}) no-repeat; width:19px;"
type="submit" value="continuar" onclick="post()"/>
<!-- <a id="continuar" onclick="selectRedirect()" alt="${fn:escapeXml(update_label)}" title="Continuar">
<img alt="${fn:escapeXml(update_label)}" class="image" src="${add_image_url}" title="Continuar" />
</a> -->
<script type="text/javascript">
/* console.log("${programa}");
Spring.addDecoration(new Spring.AjaxEventDecoration({
elementId: "continuar",
event: "onclick",
formId: "programa"
//params:{fragments: "body"}
})); */
</script>
</c:otherwise>
</c:choose>
</c:if>
</td>
<c:set var="control" value="false" />
......@@ -252,6 +249,7 @@
</table>
<script type="text/javascript">
function showRedirect(){
var radioElements = document.getElementsByName("radioButton");
console.log("${path}");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment