I believe JSF calls this "facets" and it is an interesting idea; perhaps Tapestry needs to broaden its definition of component to cover multiple areas: - traditonal components (with and without a template) - mixins/aspects/facets that wrap around components and change or filter thier behavior - facets that plug into the component as parameters, but are defined using their own elements (as in the example below)
Still, the question is ... could this be implemented better in Java code than in XML mixed inside an HTML template? On 2/1/06, Dmitry Gusev <[EMAIL PROTECTED]> wrote: > I have some ideas about component parameters. At this moment Tapestry allows > us to define parameters only as attributes for a component tag, like > everybory knows: > > <tagName jwcid="[EMAIL PROTECTED]" param1="value" param2="value"/>. > > This mechanism allows to define as well as formal and informal parameters. > It is also possible to allow body for a component in a > component-specification file. As everybody knows this body may be rendered > using @RenderBody component. > > But what I really need sometimes is to define a _formal_ body for > my component. Let's say I want to develope a @Toolbar component that manages > ToolbarItems such as ToolbarButton, ToolbarLabel, ToolbarEdit etc. It would > be good if I can write like this: > > <toolbar jwcid="@Toolbar"> > <toolbarLabel jwcid="@ToolbarLabel" ... /> > <toolbarEdit jwcid="@ToolbarEdit" .../> > <toolbarButton jwcid="@ToolbarButton" ... /> > > etc. > > </toolbar> > > ... and to check at runtime that the body is valid in order to inspect the > component body as DOM and may be even perform some XSLT transformation for > it or just use getContainer() & getComponents() and be sure that I will find > exactly what I need there. I can write like that too but I can not guarantee > that someone put some component inside of my toolbar that is not allowed > there... Thats why I think about some analogue of XML-Schema or DTD for my > component in order to control component layout in my page template. > > I know this is alitle crude but maybe some of you have also thought about > this? What do you think? > > -- Howard M. Lewis Ship Independent J2EE / Open-Source Java Consultant Creator, Jakarta Tapestry Creator, Jakarta HiveMind Professional Tapestry training, mentoring, support and project work. http://howardlewisship.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
