On Thu, 08 Jul 2010 10:38:51 -0300, matt22 <s...@zoznam.sk> wrote:

hmmm, yes...
But I want to insert components dynamically, in class:

TML:
<t:delegate to="listOfComponents" ...

JAVA:
...
Block getListOfComponents(){
  //here i must create block with some elements...
}

How to do it?

Two suggestions:

1) Implement a RenderCommand that adds the Blocks to the RenderQueue and return it in getListOfComponents(). You'll need to cast the blocks to RenderCommand.

2) Implement a component that receives the blocks to be rendered. It's beginRender() method will return the current block (Tapestry will render it) and your afterRender() method will return false if not all blocks were rendered yet.

As Kristian said, you can't instantiate components yourself, but you can render them dinamically.

--
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

Reply via email to