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:
parent
209a86a4e6
commit
01a9f8277a
|
@ -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?");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue