On 1/10/08, Ulrich Stärk <[EMAIL PROTECTED]> wrote:
>
> Zheng, Xiahong schrieb:
> > 1) Layout management: I couldn't find a documented solution to replace
> > tiles used by the old application.
> I'm no Struts expert but AFAICR tiles are just some kind of reusable
> templates. In Tapestry every component you write can be compared with a
> tile. Just write your component (with or without a template) and reuse
> it anywhere in your projects.
> To manage a common layout on all pages you write a so called Border
> component which contains layout common to all pages and that contains
> the RenderBody component. If you then wrap your page's components within
>   your Border component, the content of your Border component is
> rendered around them. Look here for an example:
> http://tapestry.apache.org/tapestry4.1/components/general/renderbody.html


One thing that may be complicating things for people with Tiles experience
is to wrap their heads around the fact that you really aren't managing page
snippets, but complete page templates in Tapestry, in other words a Tapestry
page template combines both a Tiles definition and an individiual Tiles page
snippet into one; an approach similar to Facelets. So a Tapestry page
typically always starts with a Border component of your choice (equal to a
Tiles layout definition), containing the body of the page, which the Border
component (template) then injects to an appropriate place with the help of a
Body component to produce the rendered page. What you loose compared to
Tiles is that you have to declare a Border for each page, but you get it
back with the additional flexibility of being able to easily use and switch
to different Borders and the page itself documenting which layout it's
currently using.

Kalle

>
> > 2) Dynamic attribute value generation: Something like the following you
> > can do with JSP
> >
> >               <input type="submit" value="${button. value}"/>
> >
> >    How do I achieve this in Tapestry? Is there a component I can use to
> > generate dynamic content as value for any arbitrary attribute of an HTML
> > element?
>
> In Tapestry you do that with some OGNL expression. Your example would be
> something like <input jwcid="@Submit" value="ognl:pageProperty" /> which
> would label your button according to a call of getPageProperty() on your
> page class.
>
> Cheers,
>
> Uli
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to