On Fri, 03 Jun 2011 15:33:19 -0300, Clément Uster
<clement.us...@gmail.com> wrote:
Hi all,
Hi!
I could wrap all my component into Tapestry Blocks (in my page), and then
return the block at the end of the @OnEvent method.
But I can't do this, because in some cases, the page may not know all the
component names. Do you know how I could do this ?
Notice you cannot instantiate components by yourself, so you need to
include them in a template.
Try this:
@Inject
private ComponentResources resources;
@OnEvent(EventConstants.ACTION)
public Object renderComponent(String componentId){
return resources.getEmbeddedComponent(componentid);
}
Note that that code needs you to have these components somewhere in your
template. In addition, it's based in component ids, not in component
names, but, without a t:id attribute, the component id is the component
name (except when there's more than one id-less instance of the same
component).
--
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