You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Carlos Gómez Montiel <ib...@gmail.com> on 2014/09/25 00:35:44 UTC
How can I add a component inside another component without template in T5?
I have a component without template, how can I add another component
(render) inside it?
public class Component1 {
void beginRender(MarkupWriter writer) {
// How can I render for example a tapestry's textfield component
inside this component without have a template?
}
}
Note: Component1 has no template (tml file)
RE: How can I add a component inside another component without template in T5?
Posted by Carlos Gómez Montiel <ib...@gmail.com>.
it only was a existencial question ;)
Thank you for your answer Thiago
-----Mensaje original-----
De: Thiago H de Paula Figueiredo [mailto:thiagohp@gmail.com]
Enviado el: miércoles, 24 de septiembre de 2014 06:07 p.m.
Para: Tapestry users
Asunto: Re: How can I add a component inside another component without template in T5?
On Wed, 24 Sep 2014 19:35:44 -0300, Carlos Gómez Montiel <ib...@gmail.com> wrote:
> I have a component without template, how can I add another component
> (render) inside it?
You cannot. Component instances need to be declared inside a template.
Tapestry templates are strictly static in structure, even having completely dynamic behavior, and what you're asking needs dynamic structure. Static structure allows Tapestry to be very fast and use less memory at the same time.
In a higher level, what you're trying to do? Without the answer, I can suggest you creating the template and using the If component:
<t:container xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
<t:if test="showTextField">
<t:textfiled .../>
</t:if>
</container>
In your Java class:
public boolean ifShowTextField() {
return ...
}
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: How can I add a component inside another component without
template in T5?
Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Wed, 24 Sep 2014 19:35:44 -0300, Carlos Gómez Montiel
<ib...@gmail.com> wrote:
> I have a component without template, how can I add another component
> (render) inside it?
You cannot. Component instances need to be declared inside a template.
Tapestry templates are strictly static in structure, even having
completely dynamic behavior, and what you're asking needs dynamic
structure. Static structure allows Tapestry to be very fast and use less
memory at the same time.
In a higher level, what you're trying to do? Without the answer, I can
suggest you creating the template and using the If component:
<t:container xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
<t:if test="showTextField">
<t:textfiled .../>
</t:if>
</container>
In your Java class:
public boolean ifShowTextField() {
return ...
}
--
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org