This is horrible news since I have no way of knowing the components that needs to be called at design time (other wise I would use a <t:block>).
There is no magic that can be done to achieve this at all? Even if I have to use the internal services. Thanks for your quick response. Omar On Oct 4, 2010, at 18:41, "Thiago H. de Paula Figueiredo" <thiag...@gmail.com> wrote: > On Mon, 04 Oct 2010 19:35:38 -0300, Omar Carvajal > <tapes...@carvajalonline.com> wrote: > >> Hey all, > > Hi! > >> I am trying to dynamically load a component which must be determined at >> run time, I figured I must use a t:delegate to render the component. >> On the Java side of things I cannot figure out how to instantiate the >> actual component. I saw the @Component annotation with the "type" parameter >> but this does not let me dynamically load a component from a function. >> Does anybody have any idea on how to do this? > > Declare the components inside a <t:block>. <t:block> are not rendered unless > you pass it to a Delegate or return it to update a Zone. You cannot > instantiate components in Java code, as Tapestry is static structure, dynamic > behavior (including rendering). Take a look at > http://tapestry.apache.org/tapestry5.1/cookbook/switch.html. It shows you how > to render blocks dynamically, but the same approach can be used for > components as well. You'll use @InjectComponent to get access in your Java > code to the component instances declared in templates. > > -- > Thiago H. de Paula Figueiredo > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and > instructor > Owner, Ars Machina Tecnologia da Informação Ltda. > http://www.arsmachina.com.br > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org > For additional commands, e-mail: users-h...@tapestry.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org For additional commands, e-mail: users-h...@tapestry.apache.org