【发布时间】:2014-03-17 22:54:08
【问题描述】:
我有一个 portlet(页面上只有一个 portlet)并且想在用户等待请求时显示一个微调器(或沙漏)。
在liferay-portlet.xml 中将render-weight 设置为0 有效,但随后不会加载CSS 类并且不再解析url 参数。
还有其他解决方案吗?
[我正在运行 Liferay 6.1.20 EE]
提前致谢, 法比
【问题讨论】:
我有一个 portlet(页面上只有一个 portlet)并且想在用户等待请求时显示一个微调器(或沙漏)。
在liferay-portlet.xml 中将render-weight 设置为0 有效,但随后不会加载CSS 类并且不再解析url 参数。
还有其他解决方案吗?
[我正在运行 Liferay 6.1.20 EE]
提前致谢, 法比
【问题讨论】:
通过使用 jQuery,我可以在用户点击链接时将 cursor 设置为 wait:
jqueryBusy = function(){
$("a").click(function() {
$("*").css("cursor", "wait");
});
};
我在页面加载时调用此函数,并且在某个 ajax 请求繁忙时类似地调用此函数:
if (!window["busystatus"]) {
var busystatus = {};
}
busystatus.onStatusChange = function onStatusChange(data) {
var status = data.status;
jqueryBusy(); //set jquery event handler for all links
if (status === "begin") { // turn on busy indicator
document.body.style.cursor = 'wait';
} else { // turn off busy indicator, on either "complete" or "success"
document.body.style.cursor = 'auto';
}
};
jsf.ajax.addOnEvent(busystatus.onStatusChange);
为我工作。
【讨论】: