You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Julian Wood <wo...@ucalgary.ca> on 2008/03/05 03:43:11 UTC
Re: [FAQ] common design
Does this actually work properly? I tried with 5.0.10 and 5.0.11-
SNAPSHOT.
A component like this:
<html>
<t:container xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd
">
<a t:type="PageLink" page="${page}" href="#" accesskey="$
{accessKey}" title="${title}" class="${cssClass}">${page}</a>
</t:container>
</html>
will render the <html> tags (outside the <t:container>) every time the
component is used (in another component, in my case). I checked in
jumpstart 3.3.3 as well, and it has the same problem (see
BasicCustomComponent).
BTW, I would also love to know how to do informal parameters (as you
can see from my example).
J
On Feb 29, 2008, at 9:10 AM, Christian Koeberl wrote:
>> Jesper Zedlitz <jz...@informatik.uni-kiel.de> wrote
>> This is the T4 feature:
>> <
> http://tapestry.apache.org/tapestry4/UsersGuide/template.html#template.directives.content
>>
>>
>> Is something like this possible with T5?
>
> The replacement of $content$ is the t:container construct (see
> https://issues.apache.org/jira/browse/TAPESTRY-1469).
> So, you could write:
> <html>
> <head>
> <title>This is a test</title>
> </head>
> <body>
> <t:container xmlns:t=
> "http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
> <table t:id="testGrid">
> </table>
> </t:container>
> </body>
> </html>
> T5 only renders the contents in the container, the stuff around is
> ignored
> (works since 5.0.6).
>
> There is no real replacement of $remove$ but there are some options:
> - use t:block around content to be removed
> - write a custom component Remove which returns false in
> beginRender. You
> could use it like: <tr t:type="Remove">....</tr>. Maybe Howard will
> write
> some kind of stuff (or take your comonent if you add it to a JIRA).
>
> --
> Chris
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [FAQ] common design
Posted by Sven Homburg <ho...@googlemail.com>.
a look at
http://213.160.23.119:8080/t5components/t5c-commons/ref/org/apache/tapestry/commons/components/Remove.html
mybe helps
2008/3/7, Robert Zeigler <ro...@scazdl.org>:
>
> TestPage.tml:
>
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
> <t:SampleComponent/>
> </html>
>
> SampleComponent.tml:
>
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
> <head>
> <title>If t:container replaces $content$, this shouldn't render</title>
> </head>
> <body>
> <t:container>
> This is the only thing that should render if t:container replaces
> $content$.
> </t:container>
> </body>
> </html>
>
> Rendered Output (whitespace added back in for clarity):
>
>
> <html>
> <head>
> <link href="assets/tapestry/default.css" rel="stylesheet"
> type="text/css">
> </head>
>
> <html>
> <head>
> <title>If t:container replaces $content$, this shouldn't
> render</title>
> </head>
> <body>
> This is the only thing that should render if t:container
> replaces $content$.
> </body>
> </html>
> </html>
>
>
> "the code works": Nope, it doesn't.
>
>
> Robert
>
>
> On Mar 7, 2008, at 3/711:09 AM , Christian Köberl wrote:
>
> >
> >
> > Robert Zeigler wrote:
> >>
> >> I think you're misunderstanding the point of t:container?
> >>
> > As far as I understand the comment on the JIRA
> > (
> https://issues.apache.org/jira/browse/TAPESTRY-1469?focusedCommentId=12508885
> > #action_12508885)
> > it should be a replacement of $content$.
> >
> > And, the code works - so even if it was not intended to replace
> > $content$
> > why not make t:container replace it?
> >
> > --
> > Chris
> > --
> > View this message in context:
> http://www.nabble.com/Writing-an-FAQ-for-Tapestry-5-tp15719185p15901109.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
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
--
with regards
Sven Homburg
Re: [FAQ] common design
Posted by Christian Koeberl <ch...@porsche.co.at>.
Robert Zeigler wrote:
> "the code works": Nope, it doesn't.
Now, it's getting interesting! This is what I get, when I try your code:
<html>
<head>
<link type="text/css" rel="stylesheet"
href="/assets/tapestry/default.css">
</link>
<title>If t:container replaces $content$, this shouldn't render</title>
</head>
<body> This is the only thing that should render if t:container replaces
$content$. </body>
</html>
Very strange, isn't it?
When I have this Start.tml:
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<head>
<title>myapp Start Page</title>
</head>
<body>
<t:SampleComponent />
</body>
</html>
Then I get:
<html>
<head>
<link type="text/css" rel="stylesheet"
href="/assets/tapestry/default.css">
</link>
<title>myapp Start Page</title>
</head>
<body> This is the only thing that should render if t:container replaces
$content$. </body>
</html>
Looks quite good to me.
I use Tapestry 5.0.10 on Windows JDK 5 with Jetty 5.1.14, I started with a
clean archetype generated app and added the SampleComonent and changed
Start.tml.
--
Chris
Re: [FAQ] common design
Posted by Robert Zeigler <ro...@scazdl.org>.
TestPage.tml:
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<t:SampleComponent/>
</html>
SampleComponent.tml:
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<head>
<title>If t:container replaces $content$, this shouldn't render</title>
</head>
<body>
<t:container>
This is the only thing that should render if t:container replaces
$content$.
</t:container>
</body>
</html>
Rendered Output (whitespace added back in for clarity):
<html>
<head>
<link href="assets/tapestry/default.css" rel="stylesheet"
type="text/css">
</head>
<html>
<head>
<title>If t:container replaces $content$, this shouldn't
render</title>
</head>
<body>
This is the only thing that should render if t:container
replaces $content$.
</body>
</html>
</html>
"the code works": Nope, it doesn't.
Robert
On Mar 7, 2008, at 3/711:09 AM , Christian Köberl wrote:
>
>
> Robert Zeigler wrote:
>>
>> I think you're misunderstanding the point of t:container?
>>
> As far as I understand the comment on the JIRA
> (https://issues.apache.org/jira/browse/TAPESTRY-1469?focusedCommentId=12508885
> #action_12508885)
> it should be a replacement of $content$.
>
> And, the code works - so even if it was not intended to replace
> $content$
> why not make t:container replace it?
>
> --
> Chris
> --
> View this message in context: http://www.nabble.com/Writing-an-FAQ-for-Tapestry-5-tp15719185p15901109.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
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [FAQ] common design
Posted by Christian Köberl <ch...@porsche.co.at>.
Robert Zeigler wrote:
>
> I think you're misunderstanding the point of t:container?
>
As far as I understand the comment on the JIRA
(https://issues.apache.org/jira/browse/TAPESTRY-1469?focusedCommentId=12508885#action_12508885)
it should be a replacement of $content$.
And, the code works - so even if it was not intended to replace $content$
why not make t:container replace it?
--
Chris
--
View this message in context: http://www.nabble.com/Writing-an-FAQ-for-Tapestry-5-tp15719185p15901109.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: [FAQ] common design
Posted by Robert Zeigler <ro...@scazdl.org>.
I think you're misunderstanding the point of t:container?
1) T5 templates have to be well-formed xml.
2) Well-formed xml documents have to have a single root node
3) Tapestry basically renders all of the markup in your template.
Suppose you have a component that should insert some content.
Something like:
MyComponent.tml:
<p>Here is some content to insert</p>
<p>Here is some more content to insert</p>
That won't fly for T5, because it isn't well-formed xml.
So you have to wrap it in a root node... you pick div:
<div>
<p>Here is some content to insert</p>
<p>Here is some more content to insert</p>
</div>
Problem is, now when you use your component, you get that extra
(potentially undesirable) div:
SomePage.tml:
<div id="somemeaningfulid">
<MyComponent/>
</div>
The rendered output is going to be:
<div id="somemeaningfulid">
<div>
<p>Here is some content to insert</p>
<p>Here is some more content to insert</p>
</div>
</div>
(sans the whitespace. ;)
Enter t:container. It's purpose to provide the root node for a
template which /won't/ be rendered.
We rewrite MyComponent.tml as:
<t:container>
<p>Here is some content to insert</p>
<p>Here is some more content to insert</p>
</t:container>
And now our output becomes:
<div id="somemeaningfulid">
<p>Here is some content to insert</p>
<p>Here is some more content to insert</p>
</div>
t:container is not, to my understanding, a replacement for T3 and T4's
$content$.
Cheers,
Robert
On Mar 7, 2008, at 3/710:16 AM , Christian Köberl wrote:
>
>
> Julian Wood wrote:
>>
>> I tried your code verbatim and I here's what I get rendered:
>> ...<body><h1>Test</h1><html> start Start </html></body></html>
>> This is with both 5.0.10 and 5.0.11-SNAPSHOT, so now I'm a little
>> flummoxed.
>>
> That's really weird!?
>
> Can anybody else try this example? Has anybody else had the same
> issue with
> t:container?
>
> --
> Chris
> --
> View this message in context: http://www.nabble.com/Writing-an-FAQ-for-Tapestry-5-tp15719185p15898855.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
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [FAQ] common design
Posted by Christian Köberl <ch...@porsche.co.at>.
Julian Wood wrote:
>
> I tried your code verbatim and I here's what I get rendered:
> ...<body><h1>Test</h1><html> start Start </html></body></html>
> This is with both 5.0.10 and 5.0.11-SNAPSHOT, so now I'm a little
> flummoxed.
>
That's really weird!?
Can anybody else try this example? Has anybody else had the same issue with
t:container?
--
Chris
--
View this message in context: http://www.nabble.com/Writing-an-FAQ-for-Tapestry-5-tp15719185p15898855.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: [FAQ] common design
Posted by Julian Wood <wo...@ucalgary.ca>.
But we want the component to have html and body elements (unless I
misunderstood your sentence), so that the component maintains
previewability and can be authored on it's own. When one places a
t:container inside the body element of a component, only elements
inside of the t:container should be rendered, but I'm not seeing that.
This is even more important when you're using a layout paradigm. The
case is not identical, but I think that given a page and a component
are so closely related now, it should still apply. So when you make
your page, with a t:container inside the body element of your page,
everything inside the t:container should render inside your layout
component. This isn't working for me either.
I don't know how Christian is getting it to work, but it seems he's
the only one. There is an open bug on this issue too:
https://issues.apache.org/jira/browse/TAPESTRY-1912
J
On Mar 7, 2008, at 9:12 PM, Geoff Callender wrote:
> Thanks for pointing this out. Will be fixed in JumpStart 3.4,
> replacing the component's html and body elements with a t:container
> element. Works like a charm.
>
> Geoff
> http://files.doublenegative.com.au/jumpstart/
>
> On 06/03/2008, at 4:53 AM, Julian Wood wrote:
>
>>
>> On Mar 5, 2008, at 10:26 AM, Christian Koeberl wrote:
>>
>>>> will render the <html> tags (outside the <t:container>) every
>>>> time the
>>>> component is used (in another component, in my case).
>>> I just tried this out with 5.0.10 - with my test it doesn't render
>>> the
>>> <html> tags.
>>>
>>>> I checked in jumpstart 3.3.3 as well, and it has the same problem
>>>> (see
>>> BasicCustomComponent).
>>> I don't understand what this has to do with BasicCustomComponent!?
>>
>> BasicCustomComponent demonstrates a simple component, which also
>> produces the extraneous html tags when rendered:
>>
>> <html><head><link href="../../assets/tapestry/default.css"
>> rel="stylesheet" type="text/css"></head><body><h1>Basic Custom
>> Component</h1>
>> This page shows how simple a component can be.
>> Here we've created one called BoldItalicDisplay and used it to
>> display a message in bold type and
>> italics:<br><br><html><body><strong><em>This message was generated
>> in getMessage() on Tue Mar 04 19:22:44 MST 2008.</em></strong></
>> body></html><br><br>
>> The BoldItalicDisplay component has a java ...
>>
>> I tried your code verbatim and I here's what I get rendered:
>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
>> "><html xmlns="http://www.w3.org/1999/xhtml"><head><link
>> href="assets/tapestry/default.css" rel="stylesheet" type="text/
>> css"><title>Test</title></head><body><h1>Test</h1><html>
>>
>>
>>
>> <a accesskey="a" class="x" href="start" id="pagelink"
>> title="Hello">Start</a>
>>
>>
>>
>> </html></body></html>
>> This is with both 5.0.10 and 5.0.11-SNAPSHOT, so now I'm a little
>> flummoxed.
>> J
>>
>>
>>
>>>
>>>
>>> Here's my code which doesn't render the tags:
>>> TestComponent.tml (in components):
>>> <html>
>>> <t:container xmlns:t=
>>> "http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>>> <a t:type="PageLink" page="${page}" href="#" accesskey="$
>>> {accessKey}"
>>> title="${title}" class="${cssClass}">${page}</a>
>>> </t:container>
>>> </html>
>>>
>>> TestComponent.java (in components):
>>> public class TestComponent
>>> {
>>> @Parameter
>>> private String page;
>>> @Parameter
>>> private String accessKey;
>>> @Parameter
>>> private String title;
>>> @Parameter
>>> private String cssClass;
>>> // getters
>>> }
>>>
>>> Start.tml (in pages):
>>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>>> <html xmlns="http://www.w3.org/1999/xhtml"
>>> xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>>> <head>
>>> <title>Test</title>
>>> </head>
>>> <body>
>>> <h1>Test</h1>
>>> <a t:id="testComponent"></a>
>>> </body>
>>> </html>
>>>
>>> Start.java (in pages):
>>> public class Start
>>> {
>>> @Component(parameters = {"page=literal:Start",
>>> "accessKey=literal:a", "title=literal:Hello", "cssClass=literal:x"})
>>> private TestComponent testComponent;
>>> }
>>>
>>> Produces this output:
>>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>>> <HTML xmlns="http://www.w3.org/1999/xhtml">
>>> <head>
>>> <link href="/assets/tapestry/default.css" rel="stylesheet"
>>> type="text/css">
>>> <title>
>>> Test
>>> </title>
>>> </head>
>>> <body>
>>> <h1>
>>> Test
>>> </h1>
>>> <a accesskey="a" class="x" href="/start" id="pagelink"
>>> title="Hello">
>>> Start
>>> </a>
>>> </body>
>>> </html>
>>>
>>> --
>>> Chris
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [FAQ] common design
Posted by Geoff Callender <ge...@gmail.com>.
Thanks for pointing this out. Will be fixed in JumpStart 3.4,
replacing the component's html and body elements with a t:container
element. Works like a charm.
Geoff
http://files.doublenegative.com.au/jumpstart/
On 06/03/2008, at 4:53 AM, Julian Wood wrote:
>
> On Mar 5, 2008, at 10:26 AM, Christian Koeberl wrote:
>
>>> will render the <html> tags (outside the <t:container>) every time
>>> the
>>> component is used (in another component, in my case).
>> I just tried this out with 5.0.10 - with my test it doesn't render
>> the
>> <html> tags.
>>
>>> I checked in jumpstart 3.3.3 as well, and it has the same problem
>>> (see
>> BasicCustomComponent).
>> I don't understand what this has to do with BasicCustomComponent!?
>
> BasicCustomComponent demonstrates a simple component, which also
> produces the extraneous html tags when rendered:
>
> <html><head><link href="../../assets/tapestry/default.css"
> rel="stylesheet" type="text/css"></head><body><h1>Basic Custom
> Component</h1>
> This page shows how simple a component can be.
> Here we've created one called BoldItalicDisplay and used it to
> display a message in bold type and
> italics:<br><br><html><body><strong><em>This message was generated
> in getMessage() on Tue Mar 04 19:22:44 MST 2008.</em></strong></
> body></html><br><br>
> The BoldItalicDisplay component has a java ...
>
> I tried your code verbatim and I here's what I get rendered:
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
> "><html xmlns="http://www.w3.org/1999/xhtml"><head><link
> href="assets/tapestry/default.css" rel="stylesheet" type="text/
> css"><title>Test</title></head><body><h1>Test</h1><html>
>
>
>
> <a accesskey="a" class="x" href="start" id="pagelink"
> title="Hello">Start</a>
>
>
>
> </html></body></html>
> This is with both 5.0.10 and 5.0.11-SNAPSHOT, so now I'm a little
> flummoxed.
> J
>
>
>
>>
>>
>> Here's my code which doesn't render the tags:
>> TestComponent.tml (in components):
>> <html>
>> <t:container xmlns:t=
>> "http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>> <a t:type="PageLink" page="${page}" href="#" accesskey="$
>> {accessKey}"
>> title="${title}" class="${cssClass}">${page}</a>
>> </t:container>
>> </html>
>>
>> TestComponent.java (in components):
>> public class TestComponent
>> {
>> @Parameter
>> private String page;
>> @Parameter
>> private String accessKey;
>> @Parameter
>> private String title;
>> @Parameter
>> private String cssClass;
>> // getters
>> }
>>
>> Start.tml (in pages):
>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>> <html xmlns="http://www.w3.org/1999/xhtml"
>> xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
>> <head>
>> <title>Test</title>
>> </head>
>> <body>
>> <h1>Test</h1>
>> <a t:id="testComponent"></a>
>> </body>
>> </html>
>>
>> Start.java (in pages):
>> public class Start
>> {
>> @Component(parameters = {"page=literal:Start",
>> "accessKey=literal:a", "title=literal:Hello", "cssClass=literal:x"})
>> private TestComponent testComponent;
>> }
>>
>> Produces this output:
>> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>> <HTML xmlns="http://www.w3.org/1999/xhtml">
>> <head>
>> <link href="/assets/tapestry/default.css" rel="stylesheet"
>> type="text/css">
>> <title>
>> Test
>> </title>
>> </head>
>> <body>
>> <h1>
>> Test
>> </h1>
>> <a accesskey="a" class="x" href="/start" id="pagelink" title="Hello">
>> Start
>> </a>
>> </body>
>> </html>
>>
>> --
>> Chris
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [FAQ] common design
Posted by Julian Wood <wo...@ucalgary.ca>.
On Mar 5, 2008, at 10:26 AM, Christian Koeberl wrote:
>> will render the <html> tags (outside the <t:container>) every time
>> the
>> component is used (in another component, in my case).
> I just tried this out with 5.0.10 - with my test it doesn't render the
> <html> tags.
>
>> I checked in jumpstart 3.3.3 as well, and it has the same problem
>> (see
> BasicCustomComponent).
> I don't understand what this has to do with BasicCustomComponent!?
BasicCustomComponent demonstrates a simple component, which also
produces the extraneous html tags when rendered:
<html><head><link href="../../assets/tapestry/default.css"
rel="stylesheet" type="text/css"></head><body><h1>Basic Custom
Component</h1>
This page shows how simple a component can be.
Here we've created one called BoldItalicDisplay and used it to display
a message in bold type and
italics:<br><br><html><body><strong><em>This message was generated in
getMessage() on Tue Mar 04 19:22:44 MST 2008.</em></strong></body></
html><br><br>
The BoldItalicDisplay component has a java ...
I tried your code verbatim and I here's what I get rendered:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
"><html xmlns="http://www.w3.org/1999/xhtml"><head><link href="assets/
tapestry/default.css" rel="stylesheet" type="text/css"><title>Test</
title></head><body><h1>Test</h1><html>
<a accesskey="a" class="x" href="start" id="pagelink"
title="Hello">Start</a>
</html></body></html>
This is with both 5.0.10 and 5.0.11-SNAPSHOT, so now I'm a little
flummoxed.
J
>
>
> Here's my code which doesn't render the tags:
> TestComponent.tml (in components):
> <html>
> <t:container xmlns:t=
> "http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
> <a t:type="PageLink" page="${page}" href="#" accesskey="$
> {accessKey}"
> title="${title}" class="${cssClass}">${page}</a>
> </t:container>
> </html>
>
> TestComponent.java (in components):
> public class TestComponent
> {
> @Parameter
> private String page;
> @Parameter
> private String accessKey;
> @Parameter
> private String title;
> @Parameter
> private String cssClass;
> // getters
> }
>
> Start.tml (in pages):
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml"
> xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
> <head>
> <title>Test</title>
> </head>
> <body>
> <h1>Test</h1>
> <a t:id="testComponent"></a>
> </body>
> </html>
>
> Start.java (in pages):
> public class Start
> {
> @Component(parameters = {"page=literal:Start",
> "accessKey=literal:a", "title=literal:Hello", "cssClass=literal:x"})
> private TestComponent testComponent;
> }
>
> Produces this output:
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <HTML xmlns="http://www.w3.org/1999/xhtml">
> <head>
> <link href="/assets/tapestry/default.css" rel="stylesheet"
> type="text/css">
> <title>
> Test
> </title>
> </head>
> <body>
> <h1>
> Test
> </h1>
> <a accesskey="a" class="x" href="/start" id="pagelink" title="Hello">
> Start
> </a>
> </body>
> </html>
>
> --
> Chris
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [FAQ] common design
Posted by Christian Koeberl <ch...@porsche.co.at>.
> will render the <html> tags (outside the <t:container>) every time the
> component is used (in another component, in my case).
I just tried this out with 5.0.10 - with my test it doesn't render the
<html> tags.
> I checked in jumpstart 3.3.3 as well, and it has the same problem (see
BasicCustomComponent).
I don't understand what this has to do with BasicCustomComponent!?
Here's my code which doesn't render the tags:
TestComponent.tml (in components):
<html>
<t:container xmlns:t=
"http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<a t:type="PageLink" page="${page}" href="#" accesskey="${accessKey}"
title="${title}" class="${cssClass}">${page}</a>
</t:container>
</html>
TestComponent.java (in components):
public class TestComponent
{
@Parameter
private String page;
@Parameter
private String accessKey;
@Parameter
private String title;
@Parameter
private String cssClass;
// getters
}
Start.tml (in pages):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
<head>
<title>Test</title>
</head>
<body>
<h1>Test</h1>
<a t:id="testComponent"></a>
</body>
</html>
Start.java (in pages):
public class Start
{
@Component(parameters = {"page=literal:Start",
"accessKey=literal:a", "title=literal:Hello", "cssClass=literal:x"})
private TestComponent testComponent;
}
Produces this output:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="/assets/tapestry/default.css" rel="stylesheet"
type="text/css">
<title>
Test
</title>
</head>
<body>
<h1>
Test
</h1>
<a accesskey="a" class="x" href="/start" id="pagelink" title="Hello">
Start
</a>
</body>
</html>
--
Chris