Search code examples
gwtgwtp

(GWTP) Can "placeManager.revealPlace(request)" open a URL in a new Tab?


In GWTP, to open a URL in a new tab, we can use this:

PlaceRequest request =new PlaceRequest(NameTokens.getorder).with("myID", myID);
String url =
Window.Location.createUrlBuilder().setHash(placeManager.buildHistoryToken(request)).buildString();
Window.open(url, "_blank", null);

Can we not to use Window.open & just use placeManager to achive the same thing (ie open a URL in a new Tab).

PlaceRequest request =new PlaceRequest(NameTokens.getorder).with("myID", myID);
placeManager.revealPlace(request);
// this code will open the url (ex: mydomain.com#getorder;myID=15 ) in the current browser.

The problem of Window.open(url, "_blank", null); is that sometime it opens to new tab & sometime it opens to a new Window which is inconsistent.


Solution

  • Try this one

    Window.open(url, "", "");
    

    or

    Window.open(url, "", null);