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

Unleashing the Power of Select Component


Before going further, we need to learn how to use all the capabilities that were put into the Select component by the creators of Tapestry. This component can be very convenient, and it will be definitely a popular constituent for all sorts of custom components, including those that we are going to create further in this chapter.

Let's remind ourselves that the Select component is defined on a page like this:

<t:select t:model="aModel" t:value="aValue"/>

The model parameter provides a number of items to display. These items can potentially be of any type—say, Celebrity. The model's responsibility is to explain to the component how exactly the objects should be displayed in the resulting drop-down list.

When one of the options is selected by the user and the form containing the Select component is submitted, the value parameter is used to pass the selected object to the page class. Again, we need to somehow instruct the Select component how exactly...