Tôi muốn làm điều gì đó như thế này:Execute mã trên cửa sổ gần trong GWT
Window.addWindowClosingHandler(new Window.ClosingHandler() {
@Override
public void onWindowClosing(ClosingEvent event) {
event.setMessage("Really?");
// If user clicks 'ok' in the dialog, execute code below. Else skip the code and return to window.
// CODE that does stuff goes here.
}
});
Làm thế nào để nắm bắt được thông tin từ hộp thoại?
Đây là bản sao của http://stackoverflow.com/questions/2193098/how-to-catch-user-leaving-a -page-and-canceling-it – aem
Vâng, không thực sự. Những gì tôi muốn làm khác vì tôi muốn có thể thực thi mã khi nút Ok được nhấp và không phải khi nút hủy được nhấp. – stuff22