Em Wed, 21 Jan 2009 21:30:42 -0300, manuel aldana <ald...@gmx.de> escreveu:
looking at this layout injection pattern, i wonder whether a normal
template, which references the dynamic site-parts directly wouldn't be
even easier (i at least find it more intuitive as using the <t:body/>
injection). what are the pros/cons for that?
The Layout pattern is just one ordinary Tapestry custom-made component.
The pros are the fact that you can each part in its own class/template
pair. The con is that there is no way for a component to know what the
main content is, as you named in your template below.
Site.tml (style stuff omitted):
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<head>
<t:header/>
</head>
<body>
<t:navigation/>
<t:mainContent/>
</body>
</html>
If <t:mainContent> means "the real content of each page of your
application", it should be <t:body/>. A Layout component (or any other
component) has no other way to know what is inside it (its content).
--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org