[Seaside] Does this work for you? (WAS: Broken Seaside on SqueakMap)

Nevin Pratt nevin at smalltalkpro.com
Sat Jul 5 21:46:24 CEST 2003



Derek Brans wrote:

>Hey Nevin,
>
>You're recreating a new sub-component on every render.
>

Aside from efficiency reasons, "so what" :-)

>You need to create
>and store that sub-component in an instance variable at initialization-time.
>  
>

Why?  (aside from efficiency reasons)

I can understand doing that for efficiency reasons, but it still doesn't 
answer to my mind why the example I gave doesn't work.  The example was 
meant as a most-simple example that illustrates the issue, and I think 
it worked a few revs ago (before the 'delegate' stuff came into being in 
its present incarnation-- but I could be wrong).

The *real* code I had was deliberately recreating the sub-component with 
each render, because each render could potentially yield a dramatically 
different sub-component (and also with some deliberate random-ness 
thrown in the sub-component initialization mix to make the page more 
interesting).  But after stripping away all of the superfulous stuff 
from my complicated (and now broken) code, the issue boiled down to the 
failure of the simple example I gave.  If the simple example I gave 
would work, then my more complicated code would work too.

And aside from efficiency reasons, I don't see anything wrong with the 
example code, other than it simply doesn't work (and for no apparant or 
obvious reason).  Can anybody shed any light on why it doesn't work?

Thanks,

Nevin

-- 
Nevin Pratt
Bountiful Baby
http://www.bountifulbaby.com
(801) 992-3137





More information about the Seaside mailing list