[Seaside] Seaside + Scriptaculous: Question on SUAjax onLoad,
nik.lutz at gmail.com
Tue Jun 26 23:51:11 UTC 2007
Maybe I've done something similar some time ago: After a file-upload,
the file had to be processed, that took up to several minutes....
In the callback of the upload button i forked a new thread that
processed the file:
self threadRunning: true.
self threadRunning: false.
] forkAt: Processor userBackgroundPriority named: 'Monitor import'
Render some information (duration) while the import is running, during
this time poll to see if the thread has finished:
html text: #pleaseWaitTillImportHasFinished translate ] .
self renderProgressBarOn: html.
callback: [ :r |
super renderValidationOn: r ]
r render: self elapsedTime duration ]];
with: [ ].
so instead of hiding the progress-bar, you could do another full-request....
hope it helps
2007/6/26, Lukas Renggli <renggli at gmail.com>:
> > does anybody knows how to make this work or how to do it in a better way?
> Seaside only processes one request per session at a time. It makes a
> lot of code much simpler, as you don't have to worry about
> concurrency. In your case it blocks the event handlers however, until
> the main request has been processes.
> > I don´t really know if the way i'm trying to do this is right, so if anyone
> > has a better idea it will be great!
> In general it doesn't make much sense to shoot off new requests from
> AJAX events. Most web browsers don't allow one to have more than 2
> concurrent requests anyway. To keep the responsiveness AJAX events
> anything asynchronous.
> Lukas Renggli
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
More information about the Seaside