Book Image

Tapestry 5: Building Web Applications

Book Image

Tapestry 5: Building Web Applications

Overview of this book

Table of Contents (17 chapters)
Tapestry 5
Credits
About the Author
About the Reviewers
Preface
Foreword
Where to Go Next

Different Ways of Defining Components


So far, we have seen just one approach to defining a component on a page—by using an XML element in the Tapestry namespace, like this:

<t:textfield t:value="message"/>

However, this simple approach has a downside. If we preview the Start page template in a web browser, we'll see something similar to this:

It is not a problem that the values to be inserted into the page are replaced by expansions. This is a static preview, after all. What is worse, some components have simply disappeared. We do not see the link to the Another page, and there is no text box.

This means that when we are declaring components as shown above, we are losing the ability to preview the page template in a web browser and to continue editing it using common HTML editors like Dreamweaver.

This might not be a big deal if you are creating both templates and page classes on your own and if the design of the page is not too complicated. However, web applications are often developed...