[Seaside] confused by the iframe

Nick Ager nick.ager at gmail.com
Mon Feb 15 11:57:23 UTC 2010

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:

The simplified rendering code is:

renderContentOn: html
html text: 'Upload a file:'.
 html form
attributeAt: 'target' put: 'hiddenImageUploader';
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:
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,

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20100215/4996d120/attachment.htm

More information about the seaside mailing list