[Seaside] Plotkit and Ajax

Sebastian Sastre ssastre at seaswork.com
Tue Nov 4 18:21:23 UTC 2008

Hi Karsten,

This is kind of expected to happen with all updateable components who define
behavior when page loads. If you for instance observe 'dom:loaded' and use that
to initialize the dom element somehow, you have to take care about updating it.

Every updater on one of those will create new instances (at dom) of the elements
so they could need to be initialized onComplete.
I actually don’t use onComplete for that because it happens too early. Instead I
set an #updated var to true for that element in the onComplete so it can be
initialized later.

That way, after rendering the element, the updater will execute the script (that
I've also set to be rendered in the updater callback) of that element and
(re)install behavior and (re)initialize that component. There you can do
whatever you need to hook events, set reactions, etc.


Sebastian Sastre
PD: with periodical is the same but periodically repetitive. But, it’s a pity
that Prototype's periodical hijacks onComplete for implementation and will
completely ignore your custom onComplete. This week I needed that and I had no
choice but to make my own periodical updater version which includes the
onComplete feature as anyone will expect.

> -----Mensaje original-----
> De: seaside-bounces at lists.squeakfoundation.org 
> [mailto:seaside-bounces at lists.squeakfoundation.org] En nombre 
> de Karsten
> Enviado el: Martes, 04 de Noviembre de 2008 15:14
> Para: seaside-list
> Asunto: [Seaside] Plotkit and Ajax
> Hi,
> if I try to update a PlotKit element via Ajax-Updater the 
> browser seems 
> to forget the functions that are defined in the response-html. The 
> result is that an error happens when these functions are called then. 
> The javascript that contains the functions is executed, but the 
> functions that are defined in this javascript are lost.
> Does anyone know why this happens and how one could work around this 
> problem?
> Kind Regards
> Karsten
> -- 
> Karsten Kusche - Dipl.Inf. - karsten at heeg.de
> Tel: +49 3496 21 43 29
> Georg Heeg eK - Köthen
> Handelsregister: Amtsgericht Dortmund A 12812
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

More information about the seaside mailing list