2014-07-23 126 views
0

我有這樣的代碼BrowserWindowOpener關閉事件

printWindow = new BrowserWindowOpener(invoicesBeanService.getHTMLStream());  printWindow.setFeatures("menubar=no,location=no,toolbar=no,resizable=no,scrollbars=yes,status=no,width=900"); 
printWindow.extend(this.button_2); 

我如何檢測BrowserWindowOpener關閉事件,當我關閉彈出窗口?

回答

0

添加點擊監聽器按鈕

Button button_2 = new Button("Close"); 
button_2.addClickListener(new ClickListener() { 
    private static final long serialVersionUID = 1L; 
    public void buttonClick(ClickEvent event) { 
     close(); 
    } 
}); 
printWindow.extend(button_2); 
layout.addComponent(button_2); 
+0

要簡單是真理:)。當主窗口關閉時,button_2從printwindow和資源連接器分離到printWindow丟失,導致資源刪除(動態html報告) – freeland