代码之家  ›  专栏  ›  技术社区  ›  Prabuddha Kulatunga

如何从Jasper服务器中删除加载窗口

  •  2
  • Prabuddha Kulatunga  · 技术社区  · 7 年前

    我要删除加载窗口,该窗口在加载/刷新报表时出现。 怎么做?

    有谁能告诉我jasper服务器安装目录中至少应该更改的文件名吗?

    1 回复  |  直到 7 年前
        1
  •  2
  •   Prabuddha Kulatunga    7 年前

    打开 正在加载.jsp Jasper服务器安装目录注释中的文件

    <t:insertTemplate template="/WEB-INF/jsp/templates/container.jsp">
        <t:putAttribute name="containerID" value="${not empty containerID ? containerID : 'loading'}"/>
        <t:putAttribute name="containerClass">panel dialog loading overlay moveable centered_horz centered_vert ${containerClass}</t:putAttribute>
        <t:putAttribute name="containerTitle"><spring:message code='jsp.wait'/></t:putAttribute>
        <t:putAttribute name="headerClass" value="mover"/>
        <t:putAttribute name="bodyContent" >
    
        <p class="message" role="alert" aria-live="assertive"><spring:message code='jsp.loading'/></p>
        <button id="cancel" class="button action up"><span class="wrap"><spring:message code="button.cancel"/></span><span class="icon"></span></button>
    
        </t:putAttribute>   
    </t:insertTemplate>
    

    当您像上面的例子一样,加载窗口将从任何地方消失。

    要移除特定报表的加载,

    放两个 分区 标签 身份证件 属性。然后使用js代码隐藏div。

    下面我展示了这个例子;

    <div id="prabu">
        <div id="x3">
            <t:insertTemplate template="/WEB-INF/jsp/templates/container.jsp">
                <t:putAttribute name="containerID" value="${not empty containerID ? containerID : 'loading'}"/>
                <t:putAttribute name="containerClass">panel dialog loading overlay moveable centered_horz centered_vert ${containerClass}</t:putAttribute>
                <t:putAttribute name="containerTitle"><spring:message code='jsp.wait'/></t:putAttribute>
                <t:putAttribute name="headerClass" value="mover"/>
                <t:putAttribute name="bodyContent" >
    
                    <p class="message" role="alert" aria-live="assertive"><spring:message code='jsp.loading'/></p>
                    <button id="cancel" class="button action up"><span class="wrap"><spring:message code="button.cancel"/></span><span class="icon"></span></button>
    
                </t:putAttribute>   
            </t:insertTemplate> 
        </div>
    </div>
    

    然后在下面添加javascript代码;

    <script>
        var url = window.location.href; //take current tab url
        var dash = 'http://localhost:8080/jasperserver/flow.html?_flowId=viewReportFlow&_flowId=viewReportFlow&ParentFolderUri=%2FMy_Reports&reportUnit=%2FMy_Reports%2FDashboard_Report_Original__2_&standAlone=true';
    
        if(url === dash ){
            removeElement("x3");
    
        }
    
        function removeElement(elementId) {
        // Removes an element from the document
            var element = document.getElementById(elementId);
            element.parentNode.removeChild(element);
        }
    </script>
    

    在我的例子中,我使用报表作为仪表板,并且每1分钟刷新一次,所以我只想删除仪表板报表的加载窗口。

    在js代码中, 网址 是浏览器中的当前url。 短跑 是我的仪表板报表url。

    推荐文章