Question

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.

Was it helpful?

Solution

Try this one

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

or

Window.open(url, "", null);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top