Home arrow Apache arrow The DatePicker and Shell Components of Apache Tapestry

The DatePicker and Shell Components of Apache Tapestry

In the previous article in this series we came to adding a component for accepting a date input, to specify the date of birth for the newly added celebrity. DatePicker, a standard Tapestry component, is an excellent choice for this, and we are going to learn today how to add a DatePicker to a page.

TABLE OF CONTENTS:
  1. The DatePicker and Shell Components of Apache Tapestry
  2. Shell component
  3. Possible deficiencies of DatePicker
  4. To cache or not to cache?
By: Alexander Kolesnikov
Rating: starstarstarstarstar / 16
June 05, 2007

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

However, DatePicker has a few downsides, and I am going to mention them, preparing you for the necessity of creating your own custom component for date input. Before building such a custom component, however, we'll need to have a clear understanding of the PropertySelection component and the IPropertySelectionModel interface -- this will be the topic for the next issue.

Meet DatePicker

To begin with, let's add a DatePicker to the AddCelebrity page. Mark the remaining text box (labeled "Date of Birth") as a Tapestry component:

<td>Date of Birth:</td>

<td>

   <input type="text" jwcid="dateOfBirth"/>

</td>

Configure the new component in the page specification:

<component id="dateOfBirth" type="DatePicker">

   <binding name="value" value="dateOfBirth"/>

</component>

It has a familiar value binding. The only difference with what we dealt with before is that the data type for this binding has to be java.util.Date. Let's configure a corresponding property in the page class:

public abstract Date getDateOfBirth();

Everything is as usual so far, but now DatePicker will require an additional configuration. This is because the functionality of this component is enabled by JavaScript. First of all, we need to make JavaScript libraries available for the page, and then we shall assist Tapestry in inserting the JavaScript required for DatePicker to work properly.

Tapestry 4.1 comes with an excellent Dojo JavaScript toolkit built into it. All we need to do to make this toolkit available to our page is to use a Shell component.



 
 
>>> More Apache Articles          >>> More By Alexander Kolesnikov
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

APACHE ARTICLES

- Apache Unveils Cassandra 1.2
- Apache on ARM Chips? Dell and Calxeda Help M...
- The Down Side of Open Source Software
- VMware Unveils Serengeti for Apache Hadoop
- SAP Takes Steps to Improve Hadoop Integration
- Looking to Hone Apache Hadoop Skills?
- How to Install Joomla on WAMPP
- Working with XAMPP and Wordpress
- GUI Available for Apache Camel
- Reduce Server Load for Apache and PHP Websit...
- Creating a VAMP (Vista, Apache, MySQL, PHP) ...
- Putting Apache in Jail
- Containing Intrusions in Apache
- Server Limits for Apache Security
- Setting Permissions in Apache

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: