[Seaside] onAnswer: problems

C. David Shaffer cdshaffer at acm.org
Wed Jun 2 04:03:03 CEST 2004


Attached is a change set which demonstrates a problem I'm having with 
onAnswer:.  Am I doing something stupid here?  It seems like you can't 
"self answer:" inside an onAnswer: block so top level components can't 
be triggered to answer from inner level component's answers.  I'm 
running Seaside 2.5a3 in Squeak 3.6 (5429).

David

-------------- next part --------------
WATask subclass: #ExploreTask
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'SC-Explore'!

!ExploreTask methodsFor: 'rendering' stamp: 'cds 6/1/2004 21:57'!
go
	| comp res |
	comp _ OuterComponent new.
			res _ self call: comp.
			self halt! !

"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!

ExploreTask class
	instanceVariableNames: ''!

!ExploreTask class methodsFor: 'seaside' stamp: 'cds 6/1/2004 21:54'!
canBeRoot
	^true! !


WAComponent subclass: #InnerComponent
	instanceVariableNames: ''
	classVariableNames: ''
	poolDictionaries: ''
	category: 'SC-Explore'!

!InnerComponent methodsFor: 'rendering' stamp: 'cds 6/1/2004 21:57'!
renderContentOn: html 
	html
		anchorWithAction: [self answer: 'inner']
		text: 'inner'! !


WAComponent subclass: #OuterComponent
	instanceVariableNames: 'inner '
	classVariableNames: ''
	poolDictionaries: ''
	category: 'SC-Explore'!

!OuterComponent methodsFor: 'initialization' stamp: 'cds 6/1/2004 21:56'!
initialize
	inner _ InnerComponent new.
	inner
		onAnswer: [:ans | self answer: 'dog']! !


!OuterComponent methodsFor: 'rendering' stamp: 'cds 6/1/2004 21:55'!
children
	^Array with: inner! !

!OuterComponent methodsFor: 'rendering' stamp: 'cds 6/1/2004 21:57'!
renderContentOn: html 
	html render: inner.
	html br.
	html
		anchorWithAction: [self answer: 'outer']
		text: 'outer'! !


More information about the Seaside mailing list