[Seaside] Re: Changing out components

Agamemnon andrew.evil.genius at gmail.com
Thu Oct 27 15:30:19 UTC 2011

Lukas (or anyone else with an answer),

I hate to bother you too much but while I understand conceptually your
suggestions I'm having a hard time implementing it.  Here's what I have.

RootComponent>> initialize
        super initialize.
	self menu ifNil: [self menu: MenuView new.].
	self content ifNil: [self content: FamilyView new].
	self subcomponent ifNil: [self subcomponent: FamilyEdit new].
	self menu
		viewFamily: [self content: FamilyView new];
		viewMember: [self content: MemberView new].

MenuView>> renderContentOn: html
	html div
		class: 'menu-container';
		with: [
			html anchor
				callback: [self viewFamily.];
				with: 'Family'.
			html break.
			html anchor
				callback: [self viewMember];
				with: 'Member'].

This isn't working but I'm not sure how to change it.  I also can't find any
help online for passing blocks around in Smalltalk.  I obviously need the
"self" in the block to reference the "RootComponent" even when executing in
the "MenuView" but I'm not sure that is happening or how to get it to
happen.  I can get this to work easily by removing the MenuView altogether
and placing that code in the RootComponent but that doesn't seem to be a
very modular way of doing things.


View this message in context: http://forum.world.st/Changing-out-components-tp3941427p3944919.html
Sent from the Seaside General mailing list archive at Nabble.com.

More information about the seaside mailing list