using wicket I want to open a new tab when a button or link is clicked, how can I achieve it?
what I have managed to do is to open it in a pop up like this:
PopupSettings popupSettings = new PopupSettings("popuppagemap").setLeft(0).setHeight(500).setWidth(500).setHeight(0);
// Popup example
final Link<Void> setPopupSettings = new BookmarkablePageLink<Void>("searchBtn", HomePage.class)
.setPopupSettings(popupSettings);
but this opens it in a new window.
no problem to open a link in a new tab: just add 'target="_blank"' to the link.
This is not a function of Wicket but of your browser and HTML in general.
simply add a target tag to your link:
What actually happens when the link is clicked will depend on the browser. Before browsers had tabs, this would have opened a new window, now most browsers will open a new tab by default, however, you can't depend on that happening because the feature is optional.
If you want a button instead of a link that opens a new tab you can use:
And