You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Janko Muzykant <um...@googlemail.com> on 2007/06/16 08:14:55 UTC
T5 embedded components
hi,
lets assume I have a root component with its html template. one of
components used in a template contains a component that interests me the
most. is it possible to get this embedded component from the root one? I
mean, is it generally possible to any component with allocated id from the
"root" of components tree (in my case from the Layout component) just like
this:
@Inject
private ComponentResources _resources;
_resources.getEmbeddedComponent(id);
thanks.
Re: T5 embedded components
Posted by Howard Lewis Ship <hl...@gmail.com>.
You can cast a component to type org.apache.tapestry.runtime.Component
(this interface is added to component classes at runtime). You can
than access the component's ComponentResources, including embedded
components.
This is not advised; it is possible (in much the way you can use
reflection to bypass accessor methods of Java classes) but generally
indicates that you have wandered off The Golden Path.
On 6/15/07, Janko Muzykant <um...@googlemail.com> wrote:
> hi,
> lets assume I have a root component with its html template. one of
> components used in a template contains a component that interests me the
> most. is it possible to get this embedded component from the root one? I
> mean, is it generally possible to any component with allocated id from the
> "root" of components tree (in my case from the Layout component) just like
> this:
>
> @Inject
> private ComponentResources _resources;
>
> _resources.getEmbeddedComponent(id);
>
> thanks.
>
--
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind
Professional Tapestry training, mentoring, support
and project work. http://howardlewisship.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org