2014-04-27 31 views
0

在GWTP,在新標籤中打開網頁,我們可以利用這一點:(GWTP)「placeManager.revealPlace(request)」可以在新的Tab中打開一個URL嗎?

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

我們能否不使用Window.open &只是用placeManager才達到同樣的事情(即在打開一個URL新標籤)。

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. 

Window.open(url, "_blank", null);的問題是,有時它會打開新的標籤&有時它會打開一個新的窗口,它是不一致的。

回答

1

試試這個

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

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

感謝,它的工作好了,現在 – Tum

+0

歡迎,好消息:) – Braj

相關問題