Search in sources :

Example 1 with IndicatorResult

use of org.activityinfo.legacy.shared.command.result.IndicatorResult in project activityinfo by bedatadriven.

the class ShareReportDialog method show.

public void show(final Report report) {
    if (report.getIndicators().isEmpty()) {
        MessageBox.alert(I18N.CONSTANTS.alert(), I18N.CONSTANTS.unableToShareReport(), null);
        return;
    }
    super.show();
    this.currentReport = report;
    // we need to combine the databases which already have visiblity with
    // those that could potentially be added
    BatchCommand batch = new BatchCommand();
    batch.add(new GetIndicators(currentReport.getIndicators()));
    batch.add(new GetReportVisibility(currentReport.getId()));
    dispatcher.execute(batch, new MaskingAsyncMonitor(grid, I18N.CONSTANTS.loading()), new SuccessCallback<BatchResult>() {

        @Override
        public void onSuccess(BatchResult batch) {
            populateGrid((IndicatorResult) batch.getResult(0), (ReportVisibilityResult) batch.getResult(1));
        }
    });
}
Also used : IndicatorResult(org.activityinfo.legacy.shared.command.result.IndicatorResult) ReportVisibilityResult(org.activityinfo.legacy.shared.command.result.ReportVisibilityResult) MaskingAsyncMonitor(org.activityinfo.ui.client.dispatch.monitor.MaskingAsyncMonitor) BatchResult(org.activityinfo.legacy.shared.command.result.BatchResult)

Aggregations

BatchResult (org.activityinfo.legacy.shared.command.result.BatchResult)1 IndicatorResult (org.activityinfo.legacy.shared.command.result.IndicatorResult)1 ReportVisibilityResult (org.activityinfo.legacy.shared.command.result.ReportVisibilityResult)1 MaskingAsyncMonitor (org.activityinfo.ui.client.dispatch.monitor.MaskingAsyncMonitor)1