Added onWindowClosingHandler to alert users who didn't commit changes

git-svn-id: https://svn.research-infrastructures.eu/d4science/gcube/trunk/portlets/user/share-updates@128566 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-05-12 10:31:56 +00:00
parent 209a86a4e6
commit 01a9f8277a
1 changed files with 14 additions and 4 deletions

View File

@ -277,6 +277,16 @@ public class ShareUpdateForm extends Composite {
}
}
});
// add onWindowClosing handler to alert the user who didn't share post if really wants to leave
Window.addWindowClosingHandler(new Window.ClosingHandler() {
public void onWindowClosing(Window.ClosingEvent closingEvent) {
String currentText = shareTextArea.getText();
if(!currentText.isEmpty()){
closingEvent.setMessage("Do you really want to leave the page?");
}
}
});
}
/**