[Seaside] popup window

Lukas Renggli renggli at student.unibe.ch
Wed Feb 18 07:23:38 CET 2004


Hi Nevin,

> I have a Seaside component, which renders a button (among other 
> things).  The button is hooked to an action method of the component, 
> such that when the button is pressed, the method executes.  (in other 
> words, the component is doing just normal Seaside stuff here)

I once did something like this, but this was in the Seaside 0.95 days. 
The only difference to your description is that the progress is shown 
within the same window and does not appear in a pop-up. I can't find 
the source right now, but the idea behind it is quite trivial.

1. You have your button starting the action.

2. You have a component rendering a progress-bar and a <meta 
http-equiv="refresh" content="1">   into the head. You progress-bar 
might even include a cancel-button.

3. To get everything running you have to do something like this in the 
action:

	progress := WAProgressBar new
		task: [ :progress |
			[ " do something time consuming "
			  progress percent: status.
			  progress hasCancelled
				ifTrue: [ progress answer ] ]
			repeat ];
		yourself.
	self call: progress.

4. Note that the task-block has to be forked and run in a new thread,  
else you run into troubles with Seaside. Probably you need to do some 
process synchronization too (#percent:, #answer, #hasCancelled).

I like this solution, because it doesn't involve any JavaScript tricks 
and it looks nice if your pages refresh fast.

Hope this helps,
Lukas

-- 
Lukas Renggli
http://renggli.freezope.org



More information about the Seaside mailing list