On Mon, 2007-04-02 at 20:14 +0200, Lukas Renggli wrote:
MAPriorityContainer
MAContainer
MAStringDescription
MAStringDescription
MAContainer
MAStringDescription
MAStringDescription
So I would be able to render a fieldset per container.
As containers have labels I could even render a legend
tag for the fieldsets.
But I wasn't very lucky to do so. Is this a conceptional
problem? I tried MAContainer new and setting an accessor
as well as self description copy setChildren to get a
container. But no luck.
No, I guess directly nesting the containers does not work. What you
would need to do is to create a MAToOneReferenceDescription that
points onto the next container. Too ugly for me.
MAPriorityContainer
MAToOneReferenceDescription
MAContainer
MAStringDescription
MAStringDescription
MAToOneReferenceDescription
MAContainer
MAStringDescription
MAStringDescription
Yes, that's too heavy/ugly for me, too.
What I did for grouping so far is to give every
description a #group
attribute (class extension on MADescription), so in your example this
look like:
MAPriorityContainer
MAStringDescription #group -> 'Part 1'
MAStringDescription #group -> 'Part 1'
MAStringDescription #group -> 'Part 2'
MAStringDescription #group -> 'Part 2'
And then write a specific renderer that takes advantage of this
information and displays the group headings or emits a field set
around the containing descriptions.
Yes, I thought about doing the same. I just wanted to avoid
writing renderers which carry a lot of state in their traversal.
thanks,
Norbert