Apache
  Home arrow Apache arrow The DatePicker and Shell Components of...
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
eWeek
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
APACHE

The DatePicker and Shell Components of Apache Tapestry
By: Alexander Kolesnikov
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 12
    2007-06-05

    Table of Contents:
  • The DatePicker and Shell Components of Apache Tapestry
  • Shell component
  • Possible deficiencies of DatePicker
  • To cache or not to cache?

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    TestComplete™ automates software testing for a fraction of what the big guys charge. Easy functional and load testing for all Windows, .NET, Java and Web apps. Download a free trial now.

    The DatePicker and Shell Components of Apache Tapestry
    (Page 1 of 4 )

    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.

    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


       · In this article I am doing several things at once: showing how to work with two...
       · WOW- Great tutorials! More on the way?
       · Yes, there should be soon published a tutorial on PropertySelection (Tapestry's...
       · hi alex, u promised weekly tutorials, but i guess u were caught up in work that i...
       · Thank you for your kind response!The reality is that DevShed got caught up in...
       · Hi Alexander,On the Memorial Day week, as on most holidays, we usually have a...
       · Yeah, I know, Charles, we need to be philosophical, but that's so difficult when you...
       · I have found your tutorials super helpful in learning tapestry but I have hit a road...
       · Yes, the problem is that I assumed that the readers have the source code available,...
       · Will your examples work with Tapestry 5.0.6 -- I want to reiterate how happy I am...
     

       

    APACHE ARTICLES

    - Putting Apache in Jail
    - Containing Intrusions in Apache
    - Server Limits for Apache Security
    - Setting Permissions in Apache
    - Installing Apache
    - Apache Installation and Configuration
    - Apache Tapestry and Custom Components: DateI...
    - Tapestry and AJAX: Autocompleter and InlineE...
    - PropertySelection and IPropertySelectionMode...
    - The DatePicker and Shell Components of Apach...
    - Apache Tapestry: ASO and More Components
    - Apache Tapestry and DirectLink, IoC and DI
    - Making a CelebrityCollector with Apache Tape...
    - Apache Tapestry and Listener Methods, Condit...
    - The Properties of Tapestry Pages

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway