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

DateField Component


This is a new addition that appeared only in the latest 5.0.6 version of Tapestry. Now we can use this beautiful, JavaScript-powered control without seeing even a single line of JavaScript.

Note

DateField is based on an open source DHTML/JavaScript calendar that can be found at http://www.dynarch.com/projects/calendar/.

Let's add one more piece of information to those that we already collect from the users at the Registration page—Date Of Birth. Add this table row to the template, perhaps straight under the controls used for gender selection:

<tr>
<td>Gender:</td>
<td>
<t:radiogroup t:value="gender">
<input type="radio" t:type="radio" t:value="male"/>
Male
<input type="radio" t:type="radio" t:value="female"/>
Female
</t:radiogroup>
</td>
</tr>

<tr>
<td>Birth Date:</td>
<td>
<input type="text" t:type="datefield"
t:value="dateOfBirth"/>
</td>
</tr>

We'll also need a property...