2012-04-30 26 views
1

我開發了一個java的gwt項目,它類似於web郵件。我想要下載郵件中的附件併爲此創建url並使用com.google.gwt.user.client.Window.open(url,「_ blank」,「」);運行此選項卡後,打開一個選項卡並出現下載對話框並關閉選項卡,但我想顯示保存下載對話框而無需打開和關閉新選項卡。我希望在下載附件時可以使用gamil或ymail做的事情。 這裏是我的代碼:在沒有在java中打開一個新選項卡的情況下在收件箱中下載文件gwt

`final String url= "fetchAttachment.service?index=" 
     + mailData.getId().trim() 
     + "&&" 
     + "mailboxUid=" 
     + URL.encodeComponent(mailData 
     .getMailBoxUid()) 
     + "&&" 
     + "attachmentIndex=" 
    + mailData.getAttachments().get(i) 
     .getIndex(); 
     CutLabel tempLabel = new CutLabel(attachemnts 
    .get(i).getFileName(), 100); 
     Window.open(url, "_blank", "");` 

回答

0

試試這個:

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

沒有工作,又一個標籤打開和關閉。 – Dodi

相關問題