下一页正在加载时可以使用AjaxStatus吗? [英] Can use AjaxStatus while The next Page Is Loading?

查看:200
本文介绍了下一页正在加载时可以使用AjaxStatus吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

开发SW应用程序。我已经好几次试图在我的xhtml页面转换之间显示一个模态。我不希望用户可以在下一个屏幕加载时按下许多按钮或重复按下。

Im developing a SW Application. I have been for several time trying to show a modal between the transition of my xhtml pages. I dont want the user can push many buttons or repeat pushing while the next screen is loading.

首先我尝试使用overlayPaneltrying来覆盖整个屏幕,但我发现了这个问题:

First i tried it putting an overlayPaneltrying to cover the full screen but i found this problem:

p:overlayPanel全屏

然后,我尝试过它使用blockUI阻止我的整个页面,但后来我发现了另一个问题:

Then, I tried it using blockUI blocking the whole body of my page, but then I found this other problem:

p:blockui禁用ajax

最后,我真的以为我得到了它,使用JS函数然后我有了这个问题(基本上问题是它不适用于dataTable):

Finally, I really thought that i got it, using a JS function but then I had this problem (basically the problem is that it dont works with the dataTable):

onstart和oncomplete不能在带有p:commandLink的数据表中工作

感谢U In建议!!!!

Thank U In Advice!!!!

推荐答案

使ajaxStatus尝试使其成为l请记住(不要忘记每次使用 p:ajax 时都会调用ajaxStatus,这意味着你在dataTable中尝试调用它时需要添加一个ajax事件)

to make an ajaxStatus try to make it like that (do not forget that the ajaxStatus is invoked each time you use a p:ajax that mean in your dataTable you need to add an ajax event when you try to invok it )

mypage.xhtml

mypage.xhtml

<p:ajaxStatus onstart="PF('statusDialog').show()" onsuccess="PF('statusDialog').hide()" />
<h:form id="form">
...
 </h:form>

 <p:dialog widgetVar="statusDialog" modal="true" draggable="false" closable="false" resizable="false" showHeader="false">
        <p:graphicImage name="ajaxloadingbar.gif" library="images/myIcons" />
    </p:dialog>

希望能帮到你

这篇关于下一页正在加载时可以使用AjaxStatus吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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