0

I have to validate my code first after clicking on button then need to open new page with new tab in wicket. I already used target= "_blank" option but it did't work for me.

Sopan K Kokre
  • 51
  • 1
  • 4
  • I added a button then clicking on them there is pop-up comes and after hitting on yes i have to open new page on different tab, But it opens on same page. – Sopan K Kokre Jul 04 '16 at 13:11

1 Answers1

1

Once you have the confirmation, you can utilize PopupSettings to open another page on a different tab:

PopupSettings settings = new PopupSettings();
settings.setTarget(String.format("'%s'", urlFor(AnotherPage.class, null)));
ajaxRequestTarget.appendJavaScript(settings.getPopupJavaScript());

Update: It's up to the browser though, whether a new window or a new tab is opened:

Open a URL in a new tab (and not a new window) using JavaScript

Community
  • 1
  • 1
svenmeier
  • 5,681
  • 17
  • 22
  • No this is not working this is my code here, i'm using setResponsePage() method, like below setResponsePage(new AddNewPriceOptionPage(revenueCriteria, ruleList, this.getPage().getPageReference())); – Sopan K Kokre Jul 05 '16 at 13:35
  • Actually above solution open new pop-up but i want to open new tab on same browser. – Sopan K Kokre Jul 05 '16 at 13:42
  • yes this true, But sorry i want to use setResponcePage() method and in that class object having some attributes like , List ruleList = ((ArrayList) group.getModelObject()); getRevenueCriteria(ruleList, revenueCriteria, actieTextField.getValue()); setResponsePage(new AddNewPriceOptionPage(revenueCriteria, ruleList, this.getPage().getPageReference())); so i can't use popupSetting. – Sopan K Kokre Jul 08 '16 at 07:50