Java Mailing List Archive

http://www.gg3721.com/

Home » users.tapestry »

Modifying the title in a layout component

Robert Hailey

2010-03-17

Replies: Find Java Web Hosting

Author LoginPost Reply

I'm using 5.1.0.5 and thought I could do something like this...

[Page.tml]
<html t:type="layout" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_1_0.xsd
">
  <head t:type="header">
     <title>My Page Title</title>
  </head>
  <body t:type="passthru">
     <h1>My Page Content</h1>
  </body>
</html>

The 'passthru' component was easy to make, but apparently the
t:extension-point works much more logically than I was expecting, re-
rendering it's parent template. :)

[Header.tml]
<t:extend xmlns:t="http://tapestry.apache.org/schema/
tapestry_5_1_0.xsd">
  <t:replace id="headerExtensionPoint">
 <t:body/>
  </t:replace>
</t:extend>

So my question is this, is there a component whose body can be swapped
out based on the presence of another component in the tree? Is it
possible to write one? It would be a shame to sacrifice the WYSIWYG
elegance just for the page title...

I suppose this is the way it is normally done:
http://code.google.com/p/shams/wiki/Component

--
Robert Hailey


©2008 gg3721.com - Jax Systems, LLC, U.S.A.