use of org.activityinfo.ui.client.page.common.dialog.SavePromptMessageBox in project activityinfo by bedatadriven.
the class MonthlyReportsPanel method confirmUnsavedData.
private void confirmUnsavedData(final Function function) {
if (isModified()) {
final SavePromptMessageBox box = new SavePromptMessageBox();
box.show(new SaveChangesCallback() {
@Override
public void save(AsyncMonitor monitor) {
MonthlyReportsPanel.this.save().then(new AsyncCallback<Void>() {
@Override
public void onFailure(Throwable caught) {
// handled by monitor
}
@Override
public void onSuccess(Void result) {
box.hide();
function.apply(null);
}
});
}
@Override
public void cancel() {
box.hide();
function.apply(null);
}
@Override
public void discard() {
box.hide();
function.apply(null);
}
});
}
}
Aggregations