Gwt中调用panel的setUrl方法嵌入一个网页
在网页加载过程中加入wait
在页面中加入javascript
var ready = false;
$j(document).ready(function(){
ready = true;
});//这里用了jquery
然后再java中声明
public native boolean ready(Element frame)/*-{
return frame.contentWindow.ready?true:false;
}-*/;
然后在设置Frame的url时
olapFrame = centerCp.setUrl(GWT.getHostPageBaseURL()
+ com.google.gwt.http.client.URL.encode("jsp/showOlap.jsp?dim="
+ dims + "&dimname=" + colLabels + ""));
final MessageBox box = MessageBox.wait("等待", "正在查询数据,请稍后...", "查询中...");
final Element frame = olapFrame.getElement();
final Timer t = new Timer() {
@Override
public void run() {
if (ready(frame)) {
this.cancel();
box.close();
}
}
};
t.scheduleRepeating(100);
|