单击按钮后,我必须首先验证我的代码,然后需要在 Wicket 口中使用新选项卡打开新页面。 我已经使用了 target= "_blank"选项,但它对我不起作用。
最佳答案
确认后,您可以利用 PopupSettings 在不同选项卡上打开另一个页面:
PopupSettings settings = new PopupSettings();
settings.setTarget(String.format("'%s'", urlFor(AnotherPage.class, null)));
ajaxRequestTarget.appendJavaScript(settings.getPopupJavaScript());
更新: 不过,是否打开新窗口或新选项卡取决于浏览器:
Open a URL in a new tab (and not a new window) using JavaScript
关于java - 如何使用代码在java wicket中打开新选项卡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38185535/