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

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

问题描述

我正在开发一个软件应用程序.我一直试图在我的 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.

首先我尝试放置一个overlayPanel试图覆盖全屏,但我发现了这个问题:

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 在数据表中工作

谢谢你的建议!!!!

推荐答案

要使 ajaxStatus 尝试使其成为那样(不要忘记每次使用 p:ajax 这意味着在您的 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

<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天全站免登陆