[Seaside] How to access the parent of a component?
Bahman Movaqar
Bahman at BahmanM.com
Sun Jun 2 00:49:48 UTC 2013
Hi all,
I have a big component consisting of smaller ones.
<code>
WAComponent subclass: #BigComponent
instanceVariableNames: 'smallComponent placeHolder'
classVariableNames: ''
poolDictionaries: ''
category: ''
WAComponent>>#children
^ Array with: self smallComponent with: self placeHolder.
</code>
Now I'm trying to change `placeHolder' from an `anchor' callback in
`smallComponent'.
<code>
SmallComponent>>#renderContentOn: h
h anchor
callback: [
self parent placeHolder: SomeOtherComponent new ];
with: 'Some other component' ].
</code>
But I get this exception: `SmallComponent(Object)>>doesNotUnderstand:
#parent' which, I believe, says that I cannot access the container
component like this.
What is the best way to do this (access the container component)? Is it
possible at all?
TIA,
--
Bahman Movaqar (http://BahmanM.com)
ERP Evaluation, Implementation, Deployment Consultant
More information about the seaside
mailing list