Conditional Component Index Delegator

DatePicker
org.apache.tapestry.form.DatePicker
 
Description
Provides a form Date field component for selecting dates. DatePicker presents a drop down monthly calendar for users to select dates from.

JavaScript must be enabled in the client browser to use the drop down calendar. If JavaScript is not enabled users can still enter a date value in the HTML text field.

Note a rendering feature of Netscape and Internet Explorer gives the HTML <select> element the highest Z-level index. The HTML <select> cannot be covered by other elements. If a <select> is located inside the DatePicker's popup calendar region, the <select> will render through the popup calendar obscuring part of the calendar. In these situation organize the form's UI layout so this does not occur.

See Also
Button, Form, ValidField
Parameters
Name Type Direction Required      Default      Description
value java.util.Date in yes   The data value.

Take care to ensure date time values are 'normalized' before performing any millisec based comparison or equality operations.

format String in no dd MMM yyyy The date format string. See SimpleDateFormat for format pattern letters.
disabled boolean in no false Controls whether the date field and calendar button is active or not.

Body: removed
Informal parameters: forbidden
Reserved parameters: none

Examples

This example provides a simple form where the user can select a start date and an end date.

Start Date:
End Date:
 
  
<form jwcid="form">
<table valign="middle">
 <tr>
  <td>Start Date:</td> <td><span jwcid="startDatePicker"/></td>
 </tr>
 <tr>
  <td>End Date:</td> <td><span jwcid="endDatePicker"/></td>
 </tr>
 <tr>
  <td colspan="2">&nbsp;</td>
 </tr>
 <tr>
  <td colspan="2" align="right"><input type="submit" value="Submit"/></td>
 </tr>
</table>
</form>


<component id="form" type="Form"/>
    <binding name="listener" expression="listeners.formSubmit"/>
</component>

<component id="startDatePicker" type="DatePicker">
    <binding name="value" expression="startDate"/>
</component>

<component id="endDatePicker" type="DatePicker">
    <binding name="value" expression="endDate"/>
</component>
	

public class Dates extends BasePage {
    private Date startDate;
    private Date endDate;
 
    public Date getStartDate() { return startDate; }

    public void setStartDate(Date value) {
        startDate = value;
    }

    public Date getEndDate() { return endDate; }

    public void setEndDate(Date value) {
        endDate = value;
    }  

    public void detach() {
        startDate = null;
        endDate = null;       
        super.detach();
    }

    public void formSubmit(IRequestCycle cycle) {
        // Process the submitted dates.
    }
}

Conditional Component Index Delegator