[Seaside] flow

Julian Fitzell jfitzell at gmail.com
Thu Jun 16 13:06:54 UTC 2011


Hi Milan,

The problem is that both #respond: causes the callback processing to
immediately halt so a response can be returned.

You can do other stuff in the #respond: block, which will of course happen
before the response is returned. You can also respond separately:

-------
self requestContext response
      contentType: 'application/pdf';
      document: (StandardFileStream readOnlyFileFullyNamed: fileName );
      attachmentWithFileName: fileName.

"some other stuff"

self requestContext respond.
----------

However, if your #answer is in response to a #call: that won't work either,
since that will cause the continuation to be invoked and control flow will
return to the method that did the #call: (your response will still be
configured, but the code after the #call: will be executed, possibly
altering the response). In this case, you could possibly use #home on the
calling component to remove its delegations, but I'd question why you were
using #call:/#answer: at all.

If the #answer is in response to a #show: or is triggering an #onAnswer:
block in an embedded component, it should work fine to #answer inside the
#respond: block.

Hope that's helpful.

Julian

2011/6/14 Milan Mimica <milan.mimica at gmail.com>

> Hello!
>
> I'm having trouble with page flow. At one point I need a component to issue
> a download of file and #answer back to the caller.
> I'm issuing a download using:
>
> self requestContext respond: [ :response |
>   response
>       contentType: 'application/pdf';
>       document: (StandardFileStream readOnlyFileFullyNamed: fileName );
>       attachmentWithFileName: fileName
>  ].
>
> After that, "self answer" doesn't seem to work. What can I do about it?
>
>
> --
> Milan Mimica
> http://sparklet.sf.net
>
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20110616/36ce3b8a/attachment.htm


More information about the seaside mailing list