[Seaside] what became of clearDelegate and where's my root

Avi Bryant avi at beta4.com
Sat Aug 28 23:53:19 CEST 2004

On Aug 28, 2004, at 9:51 PM, radoslav hodnicak wrote:

> Af far as I remember the discussion about components declaring their
> #children, one of the arguments was to have #clearDelegate work in a 
> clean
> manner. It's not obvious to me how to implement such method in 2.5 in 
> the
> presence of decorations and separate render loops...

This ought to work, but I haven't tested it:

	self clearAllDelegates

	self decorationChainDo:
		[:ea |
		(ea isDecoration and: [ea isDelegation]) ifTrue:
			[self removeDecoration: ea]]

> Another problem I have is that in seaside 2.3 I could access the root
> component via session, now the render loop (with its root) isn't stored
> anywhere (I guess a state holder in WAMain subclass would do?). I need 
> to
> access root to simulate user actions that result in the same state of 
> the
> application as if a real user clicked the links.

Need to access it from where?  One interesting property of 2.5 is that 
in either a render method or in a callback, the dynamic context is 
equivalent to the UI nesting - which means that if you walk back up the 
stack, you're also walking up the (current, dynamic) parent component 
chain.  This is probably the best way to find the root.

Otherwise, yeah, just stick it in an inst var on Session, I'd say...


More information about the Seaside mailing list