[Seaside] [Scriptaculous] - Combining #onClick: on a tag

Lukas Renggli renggli at gmail.com
Fri Oct 13 10:41:52 UTC 2006


> Sometime, I need to have 2 or 3 #onClick: for one tag and the result is
> not always what I expect.
>
> If two #onClick: are defined, are they fired simultanously, one after
> the other... ?

Basically JavaScript executes one statement after the other, so if you have

   ... onClick: 'alert("1");alert("2")'

you get one message box after the other, not all at once ;-)

Now, it might depend what you actually do within your statements. In
the context of [Scriptaculous] you probably mean something like ...

   ... onClick: (html update id: 'id1'; callback: [ ... ]) , (html
update id: 'id2'; callback: [ ... ])

The updaters for id1 and id2 immediately return as the updater itself
is run asynchronously (the first A in AJAX). If you want you can
change that with some setting in SUAjax. The same is true for
SUEffect.

Cheers,
Lukas

-- 
Lukas Renggli
http://www.lukas-renggli.ch


More information about the Seaside mailing list