您能否在 Windows CE 中关闭子 IE 窗口时强制将焦点集中在调用 IE 窗口上?
我有一个在运行 Windows CE 4.2/5.0 的手持设备上使用的 struts 应用程序。
我们需要在这个应用程序中使用另一个应用程序的功能,解决方案是向另一个应用程序弹出一个窗口(使用 window.open()),运行该进程,然后关闭窗口以返回到原始应用程序。
通常,我们的应用程序总是在执行操作后关注特定的文本框。当新窗口关闭时,原始窗口不会成为活动窗口,并且我很难弄清楚如何激活窗口并专注于文本框。
有没有办法控制哪个窗口在关闭时变为活动状态并在所需字段上触发焦点事件?
预先感谢您的帮助。
编辑:如果有人遇到这个问题,事实证明访问window.opener在Windows CE中不可用,除非OEM专门将其包含在他们的操作系统版本中。有关详细信息,请参阅此知识库文章。
I have a struts application being used on handheld devices running Windows CE 4.2/5.0.
We needed the functionality of another app in this one, and the solution was to pop up a window to the other app (using window.open()), run the process, and then close the window to return to the original app.
Normally our apps always focus on a specific textbox after an action. When the new window closes, the original window does not become the active window, and I'm having a hard time figuring out how to activate the window and focus on the textbox.
Is there a way to control which window becomes active when it closes and to trigger a focus event on the required field?
Thanks in advance for your help.
EDIT: In case anyone comes across this question, it turns out accessing window.opener is not available in Windows CE unless the OEM specially included it in their version of the OS. See this knowledgebase article for more information.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不确定 Windows CE,但使用 JavaScript,您可以使用
window.opener
从弹出窗口中引用父窗口。我写了一个小例子来演示。希望这对您有帮助:将其另存为
parent.html
文件:并将其另存为
child.html
:您的弹出窗口应关闭,并且应通过调用获得焦点页面,即使它位于后台或顶部有其他一些窗口。
Not sure about Windows CE but with JavaScript you can use
window.opener
to refer to the parent window from within a popup. I wrote a little example to demonstrate. Hope it will be of help to you:Save this as
parent.html
file:and this as
child.html
:Your popup should close and focus should be gained by the calling page, even if it is in the background or there is some other windows on top.