如何获取 gwt 中弹出窗口的句柄?
您好,有人可以告诉我如何在 gwt 中执行以下操作吗?
test(){
var win =
window.open("http://www.stackoverflow.com",
"mywindow",
"location=1,status=1,scrollbars=1,width=100,height=100");
win.location = "http://www.yahoo.com";
}
Hi can someone tell me how to do something like the following in gwt?
test(){
var win =
window.open("http://www.stackoverflow.com",
"mywindow",
"location=1,status=1,scrollbars=1,width=100,height=100");
win.location = "http://www.yahoo.com";
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
好的,再试一次。
我突然想到,使用 PopupPanel 或该 Widget 的某个子类。然后你就有了它的“句柄”。在面板中插入一个 Frame 小部件,并将 Frame 的 URL 设置为您想要的外部站点。使用 PopupPanel 类提供的方法处理大小调整和其他方面。
http:// /google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/user/client/ui/PopupPanel.html
http://google -web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/user/client/ui/Frame.html
OK, trying again.
Off the top of my head, use a PopupPanel or some subclass of that Widget. Then you have a "handle" to it. Insert a Frame widget in the panel and set the URL of the Frame to the external site you want. Handle the sizing and other aspects using the methods provided by the PopupPanel class.
http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/user/client/ui/PopupPanel.html
http://google-web-toolkit.googlecode.com/svn/javadoc/latest/com/google/gwt/user/client/ui/Frame.html
您可以通过创建叠加层类型来获取和操作
窗口
句柄:请注意,一旦窗口原点发生更改,您将无法再操作该窗口。
You can get and manipulate
window
handles by creating an overlay type:Note that once the window origin changes you will no longer be able to manipulate the window.