我应该在哪里使用XSP.endAjaxLoading()? [英] Where should I use XSP.endAjaxLoading()?

查看:103
本文介绍了我应该在哪里使用XSP.endAjaxLoading()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Xpage加载时间太长.因此客户要求我做一个装载指示器. 我搜索并找到XSP.startAjaxLoading(),将其放入自定义控件的onClientLoad事件. 但是现在我不知道应该在哪里放置XSP.endAjaxLoading()来使加载屏幕消失. 我试图在afterRenderResponse和beforeRenderResponse:view.postScript("XSP.endAjaxLoading()")中使用,因为此命令是CSJS,但它不起作用.

I have a Xpage that takes too long to load. So the client ask me to do a loading indicator. I searched and found XSP.startAjaxLoading(), that I put in onClientLoad event of the Custom Control. But now I don't know where should I put XSP.endAjaxLoading() to make the loading screen go away. I'tried to use in afterRenderResponse and beforeRenderResponse: view.postScript("XSP.endAjaxLoading()"), since this comand is CSJS, but it doesn't work.

谢谢.

推荐答案

我使用以下答案作为解决方案: https://stackoverflow. com/a/35481981/5339322
我几天前看过它,让我三思而后行的是,使用它我应该知道我在执行XPages来延迟什么.我运行了一些测试并发现了什么,这是对afterRestoreView事件中方法的调用,然后将其迁移到onClientLoad事件,并在上面引用的答案中使用了解决方案. 但是我担心我必须保持警惕,因此,如果有人添加了一些代码,这些代码会延迟XPages的其他事件之一,那么我必须再次移动它,如果可能的话,如果不是,我会找出与众不同的东西.

I used this answer as solution: https://stackoverflow.com/a/35481981/5339322
I've saw it a few days ago, what made me think twice is that using this i should know what is doing my XPages to delay. I ran some tests and discovered what, and it was a call to a method in the afterRestoreView event, then I migrated it to onClientLoad event and used the solution in the answer above cited. But I'm afraid that I have to keep an eye on it, so if someone adds some code that delays in one of the another events of XPages I have to move it again, of course, if it's possible, if it's not, I'll figure it out something diferent.

感谢所有答案和评论.

这篇关于我应该在哪里使用XSP.endAjaxLoading()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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