On the other hand, many Tapestry 5 developers prefer to define their components completely in the Java code of the page class (as was demonstrated in the previous chapter), and then only use t:id attributes to insert components into the template. Choose which ever approach you prefer. Let's have a look at this pair of components:
Label for the first text box:
t:value="userName"/>
The second one, TextField, is already familiar to us only this time it has a t:id="userName" attribute. The first component is new however. We can see that it is of type Label and in its t:for attribute it references the t:id attribute of TextField, so this is a label for precisely this text box. Chapter 4 [ 91 ] Notice that the Label component surrounds some not very meaningful, and probably too lengthy text. I have intentionally used such a weird text for the label so that you could appreciate the miracles that Tapestry does for us. The trick is that when the application runs and the page is rendered, the text surrounded by Label component is discarded (it might have been a part of the original mock up, and used for preview purposes only).