You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by manuel aldana <al...@gmx.de> on 2009/01/21 01:15:48 UTC
[T5] Layout component: resolving unclarities
Hi,
I had a look how to template things (header, footer, navigation) at
http://tapestry.apache.org/tapestry5/guide/layout.html.
-What is the magic about the <t:body/> inclusion? This tag is a bit
unclear to me. How does Layout.tml connect to the Start.tml as the
<t:body/> tag in the example?
-How would I include another dynamic site part, like navigation bar on
the left side (would be another .tml template)? All examples I have seen
only play with one layout "injection" (main page content).
thanks.
--
manuel aldana
aldana@gmx.de
software-engineering blog: http://www.aldana-online.de
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5] Layout component: resolving unclarities
Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Wed, 21 Jan 2009 22:07:20 -0300, manuel aldana <al...@gmx.de> escreveu:
> yes, it is a bit confusing that you could do your layout-concept
> directly as a page (see starter mail of thread). But I see now it is not
> a good idea, so will go for layout as a component :)
Technically speaking, I think it would be possible to implement the layout
concept using a page, but then your content pages would need to extend the
page component and provide the content through parameter blocks, a little
bit like <t:parameter> in Grid, BeanEditor and BeanEditForm.
But this would be much less elegant and easy than the component
implementation of the layout concept . . . ;)
--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5] Layout component: resolving unclarities
Posted by manuel aldana <al...@gmx.de>.
Thiago H. de Paula Figueiredo schrieb:
> When people here talk about a Layout component, we are talking about
> something described by the Tapestry documentation as "A Layout
> component exists to provide common content across all pages in your
> application.". A Layout is a component, not a page, at least in the
> vocabulary used in this mailing list. :)
>
> It does not mean that you cannot have more than one Layout (but they
> should be two different components, each page would use zero or one of
> them) or parameterized Layout or Layouts. ;)
yes, it is a bit confusing that you could do your layout-concept
directly as a page (see starter mail of thread). But I see now it is not
a good idea, so will go for layout as a component :)
--
manuel aldana
aldana@gmx.de
software-engineering blog: http://www.aldana-online.de
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5] Layout component: resolving unclarities
Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Wed, 21 Jan 2009 21:46:20 -0300, manuel aldana <al...@gmx.de> escreveu:
> OK, but why does the layout component need to know what the main content
> is?
If it is a layout, yes. Otherwise, it would be an ordinary page.
> As in other mail mentioned the only (but major) cons I can see is that
> making the Layout as the main-entry page is not very flexible and breaks
> somehow the tapestry page concept.
When people here talk about a Layout component, we are talking about
something described by the Tapestry documentation as "A Layout component
exists to provide common content across all pages in your application.". A
Layout is a component, not a page, at least in the vocabulary used in this
mailing list. :)
It does not mean that you cannot have more than one Layout (but they
should be two different components, each page would use zero or one of
them) or parameterized Layout or Layouts. ;)
--
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
Consultor, desenvolvedor e instrutor em Java
http://www.arsmachina.com.br/thiago
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5] Layout component: resolving unclarities
Posted by manuel aldana <al...@gmx.de>.
Thiago H. de Paula Figueiredo schrieb:
> Em Wed, 21 Jan 2009 21:30:42 -0300, manuel aldana <al...@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.
OK, but why does the layout component need to know what the main content is?
As in other mail mentioned the only (but major) cons I can see is that
making the Layout as the main-entry page is not very flexible and breaks
somehow the tapestry page concept.
--
manuel aldana
aldana@gmx.de
software-engineering blog: http://www.aldana-online.de
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5] Layout component: resolving unclarities
Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Wed, 21 Jan 2009 21:30:42 -0300, manuel aldana <al...@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-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5] Layout component: resolving unclarities
Posted by manuel aldana <al...@gmx.de>.
Maybe reason is page flexibility. With below template the target address
would always be the same page http://host/site, which is quite static.
But when using the wrapper pattern the callee would be the page (e.g.
http://host/login, http://host/item). this would feel more natural and
layout itself is not exposed as page but as component.
manuel aldana schrieb:
> thanks for the link.
>
> 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?
>
> 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>
>
> SergeEby schrieb:
>> Hi,
>>
>> <t:body/> is the actual content of your page, and the layout
>> component is
>> just a wrapper.
>>
>> This link would probably help you better understand:
>>
>> http://wiki.apache.org/tapestry/Tapestry5Layoutcomponent
>>
>>
>>
>
--
manuel aldana
aldana@gmx.de
software-engineering blog: http://www.aldana-online.de
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5] Layout component: resolving unclarities
Posted by manuel aldana <al...@gmx.de>.
thanks for the link.
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?
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>
SergeEby schrieb:
> Hi,
>
> <t:body/> is the actual content of your page, and the layout component is
> just a wrapper.
>
> This link would probably help you better understand:
>
> http://wiki.apache.org/tapestry/Tapestry5Layoutcomponent
>
>
>
--
manuel aldana
aldana@gmx.de
software-engineering blog: http://www.aldana-online.de
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5] Layout component: resolving unclarities
Posted by SergeEby <sd...@hotmail.com>.
Hi,
<t:body/> is the actual content of your page, and the layout component is
just a wrapper.
This link would probably help you better understand:
http://wiki.apache.org/tapestry/Tapestry5Layoutcomponent
/Serge
aldana wrote:
>
> Hi,
>
> I had a look how to template things (header, footer, navigation) at
> http://tapestry.apache.org/tapestry5/guide/layout.html.
>
> -What is the magic about the <t:body/> inclusion? This tag is a bit
> unclear to me. How does Layout.tml connect to the Start.tml as the
> <t:body/> tag in the example?
> -How would I include another dynamic site part, like navigation bar on
> the left side (would be another .tml template)? All examples I have seen
> only play with one layout "injection" (main page content).
>
> thanks.
>
> --
> manuel aldana
> aldana@gmx.de
> software-engineering blog: http://www.aldana-online.de
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
>
> -----
> manuel aldana
> aldana((at))gmx.de
> software-engineering blog: http://www.aldana-online.de
>
--
View this message in context: http://www.nabble.com/-T5--Layout-component%3A-resolving-unclarities-tp21574666p21574839.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5] Layout component: resolving unclarities
Posted by manuel aldana <al...@gmx.de>.
sorry... there was a discussion about this already
(http://www.mail-archive.com/users@tapestry.apache.org/msg17682.html),
but found it later as posting...
Just tell if information of above thread is out of date and tapestry
templates approach changed in latest tapestry.
manuel aldana schrieb:
> Hi,
>
> I had a look how to template things (header, footer, navigation) at
> http://tapestry.apache.org/tapestry5/guide/layout.html.
>
> -What is the magic about the <t:body/> inclusion? This tag is a bit
> unclear to me. How does Layout.tml connect to the Start.tml as the
> <t:body/> tag in the example?
> -How would I include another dynamic site part, like navigation bar on
> the left side (would be another .tml template)? All examples I have
> seen only play with one layout "injection" (main page content).
>
> thanks.
>
--
manuel aldana
aldana@gmx.de
software-engineering blog: http://www.aldana-online.de
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org