[Seaside] Scriptaculous events

Lukas Renggli renggli at gmail.com
Thu Jan 4 14:37:00 UTC 2007

>     SUEvent new event: 'foo'; on: 'click' do: SUElement new toggle.
> I tried use it with the script: message but no effect :
>     html div script: (SUEvent new event: 'foo'; on: 'click' do:
> SUElement new toggle); with: 'test'.

SUEvent is a wrapper around the JavaScript event prototype.

Current Web browsers (with the exception of the latest FireFox builds)
do not allow you to instantiate/create/trigger your own event objects.
Events are solely generated by the operating system and converted to
JavaScript objects in your Browser. The SUEvent object can only be
used within event-handlers (with the exception of #on:do:), as this is
the only place where the JavaScript variable 'event' is defined.

You can use SUEvent like this:

| x y |
x := ValueHolder new.
y := ValueHolder new.
html div
	style: 'width: 100px; height: 100px';
	onClick: (html updater
		callback: [ :v | x contents: v ] value: SUEvent new x;
		callback: [ :v | y contents: v ] value: SUEvent new y;
		callback: [ :r | html render: x contents; space; render: y contents ])

> Does anybody know how to do that or the location of some
> documentation/examples ?

I don't exactly understand what you want to do with SUEvent? Can you
elaborate your intentions?


Lukas Renggli

More information about the Seaside mailing list