[Seaside] Not able to upload [a Seaside.WAFile] through onClick
apaulavicius at gmail.com
Thu Sep 20 14:56:37 UTC 2007
I just do something like:
html iframe name: 'fileupload';
attributeAt: 'target' put: 'fileupload';
html fileUpload callback: [:f | file := f].
onClick: (html evaluator callback: [:script |
self updateErrorMesage: script]);
I hide the iframe by setting its style to
doe's uploading without refreshing the rest of the page and seems to work
in both firefox and ie
----- Original Message -----
From: "Lukas Renggli" <renggli at gmail.com>
To: "Seaside - general discussion" <seaside at lists.squeakfoundation.org>
Sent: Thursday, September 20, 2007 11:43 AM
Subject: Re: [Seaside] Not able to upload [a Seaside.WAFile] through onClick
>> Below is my attempt to implement Lukas's code but it is not recognising
>> submit, any ideas?
> 1. Do never nest forms. This won't work and will lead to all kind of
> strange problems (different ones in different browsers).
> 2. You don't need the submit button, as the form is automatically
> submitted when the user selects a file. This automatically causes a
> full refresh.
>> How would I implement Andrius's code?
> similar to the code used in the (totally unrelated) Comet package.
> 1. You create a named IFRAME that you hide somewhere on your page
> (move it somewhere outside the visible viewport, fully hiding the
> thing breaks some browsers).
> 2. You assign an onLoad event to the IFRAME that updates the part of
> the page after the successful upload.
> 3. As presented you set the target of your form to the IFRAME.
> Combined with the #onChange: on the file-upload you don't even need a
> submit button.
> Lukas Renggli
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
More information about the seaside