xpages 中的等待图标/消息 [英] Waiting icon / message in xpages

查看:49
本文介绍了xpages 中的等待图标/消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在代码运行时使用一些等待对话框/图标/图像.代码完成后想要停止该图标.我浏览了网络上提供的材料,但未能获得或理解.

I want to use some waiting dialog / icon / image when code is running. Once code is finished want to stop that icon. I have gone through material available on web but failed to get or understand.

我正在使用 SSJS 脚本,它在后端调用代理.处理需要20-30秒.

I am using SSJS script which calls agent at back end. It tooks 20-30 seconds in processing.

我经历过但不知道使用情况?

I have gone through but don't know the utilization?

https://openntf.org/XSnippets.nsf/snippet.xsp?id=bootstrap-standby-dialog

http://xpagesera.blogspot.com/2012/05/add-ajax-loading-control-in-xpages-for.html

http://lotusnotus.com/lotusnotus_en.nsf/dx/xpages-tip-a-modal-waiting-dialog-for-background-processes..htm

我已经尝试了以下方法它在 IBM Notes 9.0.1 的浏览器上运行良好,但在 XPiNC 中不起作用.在我使用 One UI V 2.1 的地方,它在 XPiNC 或 Web Client 中不起作用.

I have tried the following It's working fine with browsers for IBM Notes 9.0.1 but not working in XPiNC. Where I am using One UI V 2.1 its not working in XPiNC or in Web Client.

   <xp:this.resources>
        <xp:dojoModule name="extlib.dijit.ExtLib"></xp:dojoModule>
        <xp:dojoModule name="extlib.dijit.Loading"></xp:dojoModule>
   </xp:this.resources>

在事件处理程序中,我在页面上使用了以下事件并进行了部分刷新.

In event handler I have used following events on my page with partial refresh.

   <xp:this.onStart><![CDATA[XSP.startAjaxLoading()]]></xp:this.onStart>
   <xp:this.onComplete><![CDATA[XSP.endAjaxLoading()]]></xp:this.onComplete>
   <xp:this.onError><![CDATA[XSP.endAjaxLoading()]]></xp:this.onError>

如何通过在客户端和 One UI 2.1 上使用此代码来实现此功能.

How can I achieve this function by using this code on both clients and on One UI 2.1.

我非常感谢您对我最初的问题的回答,并希望您能得到同样的答复.

I really appreciate your responses received on my initial question and do expect the same.

最好的问候,凯撒·阿巴斯

Best Regards, Qaiser Abbas

推荐答案

这是您的第二个链接的示例 XPage 在 XPage 中为部分更新添加 AJAX加载.."控件:

Here is an example XPage for your second link Add AJAX "Loading.." control in XPages for Partial Updates:

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core" style="margin:200px">
    <xp:this.resources>
        <xp:dojoModule name="extlib.dijit.Loading" />
    </xp:this.resources>
    <xp:button id="button1" value="Show time in 3 seconds">
        <xp:eventHandler
            event="onclick"
            submit="true"
            refreshMode="partial"
            refreshId="panel1">
            <xp:this.action><![CDATA[#{javascript:
                viewScope.clickTime = new Date();
                var waitUntil = viewScope.clickTime.getTime() + 3000; 
                while(waitUntil > new Date().getTime()) {
                    // wait 3 seconds
                }
            }]]></xp:this.action>
            <xp:this.onStart><![CDATA[XSP.startAjaxLoading()]]></xp:this.onStart>
            <xp:this.onComplete><![CDATA[XSP.endAjaxLoading()]]></xp:this.onComplete>
            <xp:this.onError><![CDATA[XSP.endAjaxLoading()]]></xp:this.onError>
        </xp:eventHandler>
    </xp:button>
    <xp:panel id="panel1">
        <xp:text
            escape="true"
            id="computedField1"
            value="#{viewScope.clickTime}"
            style="font-size:48pt">
            <xp:this.converter>
                <xp:convertDateTime type="both" />
            </xp:this.converter>
        </xp:text>
    </xp:panel>
</xp:view>

当您单击按钮时,它会显示请稍候..."三秒钟,然后是按钮单击的时间.

When you click the button it shows "Please wait..." for three seconds and then the time of button click.

确保在按钮的 eventHandler 中设置 refreshMode="partial" 和有效的 refreshId.

Make sure you set refreshMode="partial" in your button's eventHandler and a valid refreshId.

这篇关于xpages 中的等待图标/消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆