cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Upayavira>
Subject Re: AJAX and upload widget
Date Fri, 11 Nov 2005 09:57:58 GMT
Antonio Gallardo wrote:
> Upayavira wrote:
>> Antonio Gallardo wrote:
>>> Hi:
>>> I was playing around AJAX and the upload widget. Why the upload widget
>>> is not supported by AJAX?
>> I started working on an AJAX progress bar for the upload widget during
>> the GetTogether.
> Great!
>> I can explain where I got to if you want to look into
>> finishing it.
> Yes, please! :-D

I've attached two patches, one for o.a.c.servlet.multipart, and one for
the forms block. This code is by no means finished, but may give you
ideas. It is based upon this demo:

I stopped at the point at which I realised that I needed to switch from
using the Prototype periodic updater to using Cocoon's own implementation.

The basic idea behind this is that when the user clicks submit, an AJAX
periodic updater is started that reloads a bit of the screen every 2
seconds. This is the progress bar. Then it submits the form into a
hidden iframe to start the upload. The upload is handled by the
MultiPart code within Cocoon, which stores vital info (e.g. total file
size, size so far) in the session, so that when the periodic updater
requests a page, the progress bar can be built based upon how much has
been uploaded so far.

Now, if you don't get a chance to look at this, either myself or a
colleague might within the next week or so.

Regards, Upayavira

View raw message