[Seaside] Re: SUSlider & SUPeriodical

Udo Schneider Udo.Schneider at homeaddress.de
Thu May 3 14:42:24 UTC 2007

Lukas Renggli wrote:
> Did you tell the SUPeriodical to evaluate scripts by sending
> evalScripts: true. Btw, the latest version of Seaside does this
> automatically, even-though this is different in the JavaScript
> documentation.
evalScripts: brought some help at least.

> If that doesn't help, maybe you want to post some code so that we can
> see what you are trying to do and why it doesn't work?
I'm still having two problems
1) two sliders appear on the website and both are functional
I assume there is a conflict between the initial render using with
and subsequent renders from the updater. But I can't quite get what
to do.

2) only the first slider gets updated on a regular basis and allways 
flickers when doing that. It seems that the whole div is redrawn 
everytime including the silder being in zero position initially.

This is the code I use (Counter is simply a global variable with
a value from 1-100):



renderContentOn: html
	html paragraph script: (html periodical frequency: 2 seconds;
			 on: #renderSliderOn: of: self;
			 evalScripts: true);
		with: [self renderSliderOn: html]

renderSliderOn: html
	html div id: 'track';
		with: [html div id: 'handle'].
	html script: (html slider handleId: 'handle';
			 trackId: 'track';
			 value: Counter;
			range: (0 to: 100);
			onChange: (html updater
					triggerSliderCallback: [:value | Counter := value asInteger]))

	^ 'div#track {
    width: 200px; height: 5px;
    background-color: #eee;
div#handle {
    width: 5px; height: 10px;
    background-color: #e8a400;
    cursor: move;

More information about the Seaside mailing list