use of org.activityinfo.legacy.shared.command.DeleteReport in project activityinfo by bedatadriven.
the class ReportGridPanel method delete.
private void delete() {
final ReportMetadataDTO report = grid.getSelectionModel().getSelectedItem();
MessageBox.confirm(I18N.CONSTANTS.delete(), I18N.MESSAGES.confirmDeleteReport(report.getTitle()), new Listener<MessageBoxEvent>() {
@Override
public void handleEvent(MessageBoxEvent be) {
if (be.getButtonClicked().getItemId().equals(Dialog.YES)) {
dispatcher.execute(new DeleteReport(report.getId()), new MaskingAsyncMonitor(ReportGridPanel.this, I18N.CONSTANTS.delete()), new AsyncCallback<VoidResult>() {
@Override
public void onFailure(Throwable caught) {
// handled by monitor
}
@Override
public void onSuccess(VoidResult result) {
grid.getStore().remove(report);
}
});
}
}
});
}
Aggregations