Em Thu, 03 Dec 2009 07:21:16 -0200, Steven Tönsing <steven.toens...@artundweise.de> escreveu:

Hi,

Hi!

So this is my sitiation :
I'm using tapestry 5.1 and i have a collection of components (Boxes) which can be placed on a page (in a certain order) the only thing i whant to do now is to get this collection of components rendered in the markup (template) of the page.

                boxes.add( new Box("box 1") );

Don't forget that you *cannot* instantiate pages or components directly.

Pretty much like this
<t:loop source="boxes" value="var:whatever">
        <t:box source="var:whatever">
</t:loop>

but this is obviously wrong. Is there a way to do so ?

This looks obviously right to me. :) What could be wrong about placing a component inside a loop or a grid? For each iteration, a new instance be be created.

public class Box {
        @Parameter
        @Property
        private String name = "noname";

This isn't the right way of giving a default value to a parameter. Anyway, it is almost always a bad idea to initialize page or component fields in their declaration. You shoud use the value attribute of @Parameter to do that.

--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor Owner, software architect and developer, 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