[Seaside] confused by the iframe

Richard Durr richard.durr at googlemail.com
Mon Feb 15 13:36:02 UTC 2010

Maybe this helps:

In your html fileUpload callback answer the following:
^ WARenderLoop new call: YourComponentForTheIframe withToolFrame: false

On Mon, Feb 15, 2010 at 12:57 PM, Nick Ager <nick.ager at gmail.com> wrote:
> Hi,
> I've implemented an 'ajax style' file upload component using a hidden iframe
> and setting the target of file-upload form to the hidden iframe, all based
> on the description in this
> message: http://lists.squeakfoundation.org/pipermail/seaside/2007-September/014368.html
> The simplified rendering code is:
> renderContentOn: html
> html text: 'Upload a file:'.
> html form
> attributeAt: 'target' put: 'hiddenImageUploader';
> multipart;
> with: [
> html fileUpload
> callback: [:aFile| file := aFile];
>                                 onChange: ('this.form.submit()')
> ].
> html iframe
> name: 'hiddenImageUploader';
> style: 'position:absolute;top:-1000px;left:-1000px';
> contents: [self renderIFrameContentOn: html]
> It works as anticipated, except that after a file is uploaded the html
> response comes from rendering a complete page. This becomes the content of
> the iframe. Ideally I'd like the iframe content just to contain a set of
> image tags referencing the uploaded images that I can then use as feedback
> on the main page via an onload hook and some jQuery DOM manipulation.
> My first attempted solution tried to replace the contents of the response
> buffer with my desired content, see:
> http://lists.squeakfoundation.org/pipermail/seaside/2010-February/022499.html.
> The problem is the response buffer already contains a partial response
> before my code is called.
> My new plan is to change the rendering pass after my callback is fired to
> route it directly to my custom rendering code. Unfortunately I don't
> understand the way in which code is called in the various phases of a
> Seaside response. Is it possible to force the rendering phase to a specific
> block of code, or simply pass a string containing the html I wish to return
> to the rendering phase?
> Thanks in advance,
> Nick
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

More information about the seaside mailing list