All components declared in a template or class for a component/page are
"embedded components". They all share the same parent component/page
which is returned by getContainer() as you've seen.

This is completely separate from the DOM hierarchy that T5 builds as it
renders. In that case you can navigate elements (but not components) e.g:

void beginRender(MarkupWriter writer)
{
        Element element = writer.getElement();
        Element parent = element.getParent();
        ...
}

At least, that is my undestanding so far.

Cheers,
Nick.


David Avenante wrote:
Hi,

I try to create sub compponent in T5 (5.0.5).

My template is :

<div t:type="myComponent1">
       <div t:type="myCompopnent2">
           <h1>Content</h1>
       </div>
</div>

In myComponent2 class when i try to access to the Container :

@Inject
private ComponentResources componentResources;

componentResources.getContainer(), tapestry return to me my page and
not my component.

If I place :
<div t:type="myCompopnent2">
       <h1>Content</h1>
</div>

in myCompnent1 template it's works !!!!

Why and what is the difference ?

Thank for any input.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to