Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Call back for file download not being called

    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>

    #2
    Callbacks don't fire for downloads - this is documented behavior.

    It's very very difficult to get notification of download completion. It's usually best to arrange your application such that you don't require it.

    Comment

    Working...
    X