如何从 Wicket 模式对话框打开外部网页
我在 Wicket 中有一个包含链接的模式对话框。我需要通过点击打开外部网页(例如 http://www.google.com)链接。链接的目标是动态设置的。我该怎么做?
我认为我的问题不太清楚(对此我深表歉意)。我需要从模式对话框打开网页。实际上,我可以在 @Don Roby 向我建议的模态对话框示例中解释问题(wicketstuff.org/wicket14/ajax/modal-window.0)。如果我们单击示例中的“显示带有页面的模式对话框”链接,将显示模式对话框以及另一个名为“打开另一个模式对话框”的链接。通过单击该链接,我想打开网页(例如:www.google.com)。我的问题是:在这种情况下如何打开网页?
I have a modal dialog in Wicket that contains a link. I need to open an external web page (for example, http://www.google.com) by clicking on the link. The target of the link is set dynamically. How can I do this?
I think that my question hasn't been so clear(I apologize for that). I need to open Web page from modal dialog. Actually, I can explain the problem in the example of modal dialog that @Don Roby has proposed me (wicketstuff.org/wicket14/ajax/modal-window.0). If we click the "Show modal dialog with a page" link in the example, there will be shown the modal dialog with another link called "Open another modal dialog". By clicking on that link, I want to open Web page (for example: www.google.com). My question is: how to open a Web page in this situation?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以使用 PageCreator(而不是 setContent()),并返回 RedirectPage:
You can use a PageCreator (instead of setContent()), and return a RedirectPage:
我明白你的意思。
我在这里找到了解决方案:
http://apache-wicket.1842946.n4.nabble.com/How-to-redirect-from-a-ModalWindow-td1889646.html
I understand what you mean.
I have found the solution here :
http://apache-wicket.1842946.n4.nabble.com/How-to-redirect-from-a-ModalWindow-td1889646.html
听起来您已经知道如何处理模态,但是有一个执行此操作的示例 这里。打开外部链接并不困难,这里有一个示例 。
It sounds like you already know how to deal with the modal, but there's an example of doing it here. Opening an external link is not difficult, and there's an example of doing it here.
你如何创建你的链接?
您尝试过使用 externalLink 吗?
新的ExternalLink(“applicationLink”,“http://www.google.com”);
how do you create your link ?
did you tried with an externalLink ?
new ExternalLink("applicationLink","http://www.google.com");