[Seaside] self call: not working

Randal L. Schwartz merlyn at stonehenge.com
Fri Jan 25 13:10:57 UTC 2008


>>>>> "John" == John Thornborrow <john at pinesoft.co.uk> writes:

John> Hi all,
John> I'm trying to use #call: but it's not working as expected.

John> renderContentOn: html
John> 	| answer |	
John> 	answer := self call: (MyComponent new).
John> 	"do other stuff with answer .."

John> Another (and simple) example:

John> renderContentOn: html
John>   self inform: 'foobar'

#call: replaces the current component with another, and should not
be used in render methods: only in callbacks.

If you want your top-level component to have no native rendering of its own,
just calling other components, you should be using a WATask and overriding #go
instead of overriding #renderContentOn: in a WAComponent.

See
http://methodsandmessages.vox.com/library/post/seaside-watask-vs-wacomponent.html
and
http://methodsandmessages.vox.com/library/post/a-few-bits-about-children-in-seaside.html
for details. (And yes, I'm moving some of this into the FAQ when I get back
from this trip!)

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn at stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


More information about the seaside mailing list