[Seaside] SU: Periodical evaluation
Udo.Schneider at homeaddress.de
Thu Sep 13 19:18:53 UTC 2007
I'm still trying to find my way through Seaside&script.aculo.us and now
have something where I think it should work but I have no idea how to do it.
The basic task is to update multiple things in a website. I achieved
this with the following code:
times := (1 to: 10)
collect: [:each | Time now addSeconds: each * 5].
^ super initialize
^ (times indexOf: aTime) displayString
renderTime: time on: html
id: (self idFor: time);
with: [time < Time now
ifTrue: [html text: 'Done']
ifFalse: [html text: 'toDo'].
html space; render: time]
do: [:each | html listItem
with: [self renderTime: each on: html]]].
onClick: (html evaluator
callback: [:script | times
do: [:eachTime | script element
id: (self idFor: eachTime);
render: [:render | self renderTime: eachTime on: render]]]);
Using this code each time I click the link the elements are updated.
However I do not want the user to refresh manually but to call the
I succeeded in updating single elements with "updater every: 10 seconds"
w/o problem. But I didn't find a way to have the evaluator called in a
More information about the seaside