[Seaside-dev] FW: Deferring file downloads until link is clicked

Philippe Marschall philippe.marschall at gmail.com
Thu Oct 16 18:32:55 UTC 2014


On Thu, Oct 16, 2014 at 2:43 PM, Tanner, Brian <brian.tanner at hp.com> wrote:
>
> Now sent van my registered e-mail adress
>
> _____________________________________________
> From: Tanner, Brian
> Sent: donderdag 16 oktober 2014 14:33
> To: 'seaside-dev at lists.squeakfoundation.org'
> Subject: Deferring file downloads until link is clicked
>
>
> Dear mailing list,
>
> I’m having problems downloading documents using Seaside with Cincom Smalltalk 7.9.1.
>
> I see that a document is downloaded during rendering whilst I wish that to be deferred until the user clicks op the link (anchor). On the Seaside website (documentation, FAQ, How to: entry 14) there is an explanation of how to resolve this problem by using a callback on the anchor:
>
> Is there a convenient way to make the document be created after the link is clicked?
> Yes, this is a common problem. One solution is to create an anchor and redirect:
> html anchor
>     callback: [
>         self session returnResponse: (WAResponse
>             document: anObject
>             mimeType: aMimeType
>             fileName: aString) ];
>     with: 'Export'.
>
> This information however seems to be outdated.

Yes, that's Seaside 2.x style. I just fixed this

> There is for example no Class method WAResponse>>document:mimeType:filename , there is however an instance method with this name. I understand that I need to access the response in the active Request Context, but how do I do that?

Which version of Seaside do you use? If you're unsure you can inspect
the following

GRPlatform current seasideVersion

In Seaside 3.x you'd use something along the lines of:

 self requestContext respond: [ :response |
        response
              document: anObject
              mimeType: aMimeType
              fileName: aString ]


Cheers
Philippe


More information about the seaside-dev mailing list