Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Call back for file download not being called

$
0
0
smartgwt.version=3.1-p20130620

I am using the DSRequest class to download a file. I can successfully download a file.

However, I would like to get informed on the client side when the download is complete.

Here is the code I'm using on the client:

Code:

/**
 * Set up the request to download
 */
DataSource dataSource = DataSource.get("download");
DSRequest dsRequest = new DSRequest();
dsRequest.setOperationId("downloadClassificationResults");
dsRequest.setDownloadResult(true);
dsRequest.setDownloadToNewWindow(false);

/**
 * Create data source call back
 */
DSCallback dsCallBack = new DSCallback() {

        @Override
        public void execute(DSResponse response, Object rawData,
                        DSRequest request) {
                ClientLogger.log(this, "call back from download");
        }
};

/**
 * download the results
 */
dataSource.fetchData(criteria, dsCallBack, dsRequest);

DSCallback.execute never gets called.

Here is the data source xml file:

Code:

<DataSource dbName="Mysql" tableName="download" ID="download"
        dataSourceVersion="1" generatedBy="v8.3p_2013-05-10/EVAL Deployment 2013-05-10"
        serverType="sql">

        <fields>
                <field primaryKey="true" name="ID" type="sequence"></field>
        </fields>

        <operationBindings>
                <binding operationId="download" operationType="fetch"
                        serverMethod="downloadData">
                        <serverObject lookupStyle="new"
                                className="com.cedarcone.Orchestrate.server.samples.Downloader" />
                </binding>
                <binding operationId="downloadClassificationResults" operationType="fetch"
                        serverMethod="downloadClassificationResults">
                        <serverObject lookupStyle="new"
                                className="com.cedarcone.Orchestrate.server.contactclassifier.ContactClassifier" />
                </binding>
        </operationBindings>
</DataSource>


Viewing all articles
Browse latest Browse all 4756

Trending Articles