Hi there,
Apologies but I've searched the forum and cannot find an answer to this particular problem.
- I've got a servlet streaming files.
- If I go to it's URL directly, I get the desired "Save file as" browser popup.
I found an example of what I'm looking for here: http://www.smartclient.com/smartgwtee/showcase/#excel_export
If you click export, it downloads the file. However I'm not using SmartGWT EE.
In my SmartGWT application, nothing seems to happen when I send a request to the same URL.
I've tried it a number of ways. None of which work. Here are my attempts:
Attempt 1 (using a hidden frame):
Attempt2 (using the RPCManager):
The first attempt freezes the application, and eventually garbage is displayed in the 100x100 iframe.
The second attempt fires the callback method almost instantly, but no file downloaded.
Is there something I'm missing? If I go to the URL directly, the file does not open inline, it asks me to download, so I am sure the servlet is OK.
Thanks in advance
Alan
Apologies but I've searched the forum and cannot find an answer to this particular problem.
- I've got a servlet streaming files.
- If I go to it's URL directly, I get the desired "Save file as" browser popup.
I found an example of what I'm looking for here: http://www.smartclient.com/smartgwtee/showcase/#excel_export
If you click export, it downloads the file. However I'm not using SmartGWT EE.
In my SmartGWT application, nothing seems to happen when I send a request to the same URL.
I've tried it a number of ways. None of which work. Here are my attempts:
Attempt 1 (using a hidden frame):
Code:
HTMLPane hiddenFrame = new HTMLPane(); hiddenFrame.setWidth(100); //would set to 1 after tests hiddenFrame.setHeight(100);//would set to 1 after tests parent.addMember(hiddenFrame); hiddenFrame.setIFrameURL(url);
Code:
RPCRequest req = new RPCRequest(); req.setActionURL(url); RPCCallback callback = new RPCCallback() { public void execute(RPCResponse response, Object rawData, RPCRequest request) { SC.say("File downloaded!"); } }; RPCManager.sendRequest(req, callback);
The second attempt fires the callback method almost instantly, but no file downloaded.
Is there something I'm missing? If I go to the URL directly, the file does not open inline, it asks me to download, so I am sure the servlet is OK.
Thanks in advance
Alan
Comment