Search in sources :

Example 1 with RenderElement

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

the class ExportReportTask method start.

@Override
public void start(final AsyncCallback<ExportDialog.AsyncTaskPoller> callback) {
    RenderElement command = new RenderElement(model, format);
    command.setFilename(filename);
    dispatcher.execute(command, new AsyncCallback<UrlResult>() {

        @Override
        public void onFailure(Throwable caught) {
            callback.onFailure(caught);
        }

        @Override
        public void onSuccess(final UrlResult urlResult) {
            callback.onSuccess(new ExportDialog.AsyncTaskPoller() {

                @Override
                public void poll(ExportDialog.ProgressCallback callback) {
                    callback.onDownloadReady(urlResult.getUrl());
                }
            });
        }
    });
}
Also used : RenderElement(org.activityinfo.legacy.shared.command.RenderElement) UrlResult(org.activityinfo.legacy.shared.command.result.UrlResult)

Aggregations

RenderElement (org.activityinfo.legacy.shared.command.RenderElement)1 UrlResult (org.activityinfo.legacy.shared.command.result.UrlResult)1