I've been writing a couple of Pier components,
let's call them
StructureA and StructureB (both subclassed from PRStructure), and each
has a corresponding view (answered by #viewComponentClass), ViewA and
ViewB (subclassed from PRDefaultView).
Now I find I want to embed a 'B' inside of an 'A', so that ViewB gets
rendered inside of ViewA.
I've added a StructureB instance as a child of the StructureA instance.
What I can't figure out is, from within ViewA>>renderContentOn:, how do
I go about getting hold of an instance of ViewB, so that I can pass it
as an arg to "html render: ... " ?
Views do not really nest well. It probably can be done, but is
certainly tricky. What I would do is to extract the rendering code of
ViewA and ViewB to separate classes (components, renderable objects,
visitors, ...) that can then be arbitrarily composed in ViewA and B.
This is also what the blog is to display the posts in different ways.
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch