You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Blackwings <lo...@gmail.com> on 2006/07/15 18:59:52 UTC

Components inside component

Hello everybody,

I'm new in Tapestry and, in fact, my boss asked me to try Tapestry to be
able to compare with Struts in term of development time, efficiency, etc
etc... yes, we are going to replace our old GUI web layer ;-)

Anyway, I have a question maybe you will be able to answer :

I would like to know how I could render a component, for example a list of
custom <td ...></td> inside a custom <tr...></tr> component.

<table>
 <tr jwcid="myTr@CustomTr" ...>
   <td class="myTdClass">Something here</td>
   <td class="mySecondTdClass">Something else here</td>
   <td jwcid="myTd@CustomTd" ...>Placeholder #1</td>
   <td jwcid="%remove%" ...>Placeholder #2</td>
   <td jwcid="%remove%" ...>Placeholder #3</td>
 </tr>
</table>

So I want to be able to render something like that. CustomTr is aware it
needs CustomTd and should pass some parameters to CustomTd.
CustomTd is a component which need some parameters to be render.
And I can imagine I could have another component CustomTr2 capable to nest
the same CustomTd.
My problem is the way to defined and declare them. Is it possible to create
only one template, a page template to define this sort of "nested component"
or do I have to ask the web-designer to create another template for the
CustomTd component as well?


I found how to create one component but not how to create a nested component
and to pass parameters from the "parent" to the "child".

Thanks a lot

BW