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

Derek Brans brans at nerdonawire.com
Sat Jul 5 20:53:35 CEST 2003


Hey Nevin,

You're recreating a new sub-component on every render.  You need to create
and store that sub-component in an instance variable at initialization-time.

Derek Brans
Nerd on a Wire
Web design that's anything but square
http://www.nerdonawire.com
mailto: brans at nerdonawire.com
phone: 604.874.6463
toll-free: 1-877-NERD-ON-A-WIRE
----- Original Message -----
From: "Nevin Pratt" <nevin at smalltalkpro.com>
To: <seaside at lists.squeakfoundation.org>; <avi at beta4.com>
Sent: Saturday, July 05, 2003 1:59 PM
Subject: [Seaside] Does this work for you? (WAS: Broken Seaside on
SqueakMap)


> In a previous thread, I talked about "Broken Seaside on SqueakMap".
>  Here is the simplest case I could come up that exhibits the problem:
>
> Create two components (both are subclasses of WAComponent).  Name one of
> them "MyComponent", and the other "MySubComponent".
>
> ******
> Implement the following "MySubComponent" instance methods:
>
> doit
>     self inform: 'You did it!'
>
>
> renderContentOn: html
>     html
>         form: [html
>                 submitButtonWithAction: [self doit]
>                 text: 'Press this button to do it!']
>
> ******
> Implement the following "MyComponent" instance method:
>
> renderContentOn: html
>     | sub |
>     sub _ MySubComponent new.
>     html render: sub
>
> ******
>
> Now via the usual 'config' app, define the "MyComponent" app, and
> execute it.  When you press the button, the 'self inform:' never
> happens.  However, you can put a 'self halt' in the #doit method, and it
> will halt, so you know that the #doit method is being executed.
>
> If I instead define the "MySubComponent" app (via 'config'), and execute
> it, the 'self inform:' works fine.  Thus, the problem only happens when
> "MySubComponent" is embedded within "MyComponent" (and I think it is
> related to the 'delegate' scheme used in Seaside).
>
> Nevin
>
>
> --
> Nevin Pratt
> Bountiful Baby
> http://www.bountifulbaby.com
> (801) 992-3137
>
>
> _______________________________________________
> Seaside mailing list
> Seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/listinfo/seaside
>
>




More information about the Seaside mailing list