You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2007/10/21 18:23:59 UTC

svn commit: r586916 [6/6] - in /tapestry/tapestry5/trunk: tapestry-core/ tapestry-core/src/main/java/org/apache/tapestry/corelib/base/ tapestry-core/src/main/java/org/apache/tapestry/corelib/components/ tapestry-core/src/main/java/org/apache/tapestry/c...

Added: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/skins/aqua/theme.css
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/skins/aqua/theme.css?rev=586916&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/skins/aqua/theme.css (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/skins/aqua/theme.css Sun Oct 21 09:23:51 2007
@@ -0,0 +1,236 @@
+/* Distributed as part of The Coolest DHTML Calendar
+   Author: Mihai Bazon, www.bazon.net/mishoo
+   Copyright Dynarch.com 2005, www.dynarch.com
+*/
+
+/* The main calendar widget.  DIV containing a table. */
+
+div.calendar { position: relative; }
+
+.calendar, .calendar table {
+  border: 1px solid #bdb2bf;
+  font-size: 11px;
+  color: #000;
+  cursor: default;
+  background: url("normal-bg.gif");
+  font-family: "trebuchet ms",verdana,tahoma,sans-serif;
+}
+
+.calendar {
+  border-color: #797979;
+}
+
+/* Header part -- contains navigation buttons and day names. */
+
+.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */
+  text-align: center;    /* They are the navigation buttons */
+  padding: 2px;          /* Make the buttons seem like they're pressing */
+  background: url("title-bg.gif") repeat-x 0 100%; color: #000;
+  font-weight: bold;
+}
+
+.calendar .nav {
+  font-family: verdana,tahoma,sans-serif;
+}
+
+.calendar .nav div {
+  background: transparent url("menuarrow.gif") no-repeat 100% 100%;
+}
+
+.calendar thead tr { background: url("title-bg.gif") repeat-x 0 100%; color: #000; }
+
+.calendar thead .title { /* This holds the current "month, year" */
+  font-weight: bold;      /* Pressing it will take you to the current date */
+  text-align: center;
+  padding: 2px;
+  background: url("title-bg.gif") repeat-x 0 100%; color: #000;
+}
+
+.calendar thead .headrow { /* Row <TR> containing navigation buttons */
+}
+
+.calendar thead .name { /* Cells <TD> containing the day names */
+  border-bottom: 1px solid #797979;
+  padding: 2px;
+  text-align: center;
+  color: #000;
+}
+
+.calendar thead .weekend { /* How a weekend day name shows in header */
+  color: #c44;
+}
+
+.calendar thead .hilite { /* How do the buttons in header appear when hover */
+  background: url("hover-bg.gif");
+  border-bottom: 1px solid #797979;
+  padding: 2px 2px 1px 2px;
+}
+
+.calendar thead .active { /* Active (pressed) buttons in header */
+  background: url("active-bg.gif"); color: #fff;
+  padding: 3px 1px 0px 3px;
+  border-bottom: 1px solid #797979;
+}
+
+.calendar thead .daynames { /* Row <TR> containing the day names */
+  background: url("dark-bg.gif");
+}
+
+/* The body part -- contains all the days in month. */
+
+.calendar tbody .day { /* Cells <TD> containing month days dates */
+  font-family: verdana,tahoma,sans-serif;
+  width: 2em;
+  color: #000;
+  text-align: right;
+  padding: 2px 4px 2px 2px;
+}
+.calendar tbody .day.othermonth {
+  font-size: 80%;
+  color: #999;
+}
+.calendar tbody .day.othermonth.oweekend {
+  color: #f99;
+}
+
+.calendar table .wn {
+  padding: 2px 3px 2px 2px;
+  border-right: 1px solid #797979;
+  background: url("dark-bg.gif");
+}
+
+.calendar tbody .rowhilite td,
+.calendar tbody .rowhilite td.wn {
+  background: url("rowhover-bg.gif");
+}
+
+.calendar tbody td.today { font-weight: bold; /* background: url("today-bg.gif") no-repeat 70% 50%; */ }
+
+.calendar tbody td.hilite { /* Hovered cells <TD> */
+  background: url("hover-bg.gif");
+  padding: 1px 3px 1px 1px;
+  border: 1px solid #bbb;
+}
+
+.calendar tbody td.active { /* Active (pressed) cells <TD> */
+  padding: 2px 2px 0px 2px;
+}
+
+.calendar tbody td.weekend { /* Cells showing weekend days */
+  color: #c44;
+}
+
+.calendar tbody td.selected { /* Cell showing selected date */
+  font-weight: bold;
+  border: 1px solid #797979;
+  padding: 1px 3px 1px 1px;
+  background: url("active-bg.gif"); color: #fff;
+}
+
+.calendar tbody .disabled { color: #999; }
+
+.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */
+  visibility: hidden;
+}
+
+.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */
+  display: none;
+}
+
+/* The footer part -- status bar and "Close" button */
+
+.calendar tfoot .footrow { /* The <TR> in footer (only one right now) */
+  text-align: center;
+  background: #565;
+  color: #fff;
+}
+
+.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */
+  padding: 2px;
+  background: url("status-bg.gif") repeat-x 0 0; color: #000;
+}
+
+.calendar tfoot .hilite { /* Hover style for buttons in footer */
+  background: #afa;
+  border: 1px solid #084;
+  color: #000;
+  padding: 1px;
+}
+
+.calendar tfoot .active { /* Active (pressed) style for buttons in footer */
+  background: #7c7;
+  padding: 2px 0px 0px 2px;
+}
+
+/* Combo boxes (menus that display months/years for direct selection) */
+
+.calendar .combo {
+  position: absolute;
+  display: none;
+  top: 0px;
+  left: 0px;
+  width: 4em;
+  cursor: default;
+  border-width: 0 1px 1px 1px;
+  border-style: solid;
+  border-color: #797979;
+  background: url("normal-bg.gif"); color: #000;
+  z-index: 100;
+  font-size: 90%;
+}
+
+.calendar .combo .label,
+.calendar .combo .label-IEfix {
+  text-align: center;
+  padding: 1px;
+}
+
+.calendar .combo .label-IEfix {
+  width: 4em;
+}
+
+.calendar .combo .hilite {
+  background: url("hover-bg.gif"); color: #000;
+}
+
+.calendar .combo .active {
+  background: url("active-bg.gif"); color: #fff;
+  font-weight: bold;
+}
+
+.calendar td.time {
+  border-top: 1px solid #797979;
+  padding: 1px 0px;
+  text-align: center;
+  background: url("dark-bg.gif");
+}
+
+.calendar td.time .hour,
+.calendar td.time .minute,
+.calendar td.time .ampm {
+  padding: 0px 5px 0px 6px;
+  font-weight: bold;
+  background: url("normal-bg.gif"); color: #000;
+}
+
+.calendar td.time .hour,
+.calendar td.time .minute {
+  font-family: monospace;
+}
+
+.calendar td.time .ampm {
+  text-align: center;
+}
+
+.calendar td.time .colon {
+  padding: 0px 2px 0px 3px;
+  font-weight: bold;
+}
+
+.calendar td.time span.hilite {
+  background: url("hover-bg.gif"); color: #000;
+}
+
+.calendar td.time span.active {
+  background: url("active-bg.gif"); color: #fff;
+}

Added: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/skins/aqua/title-bg.gif
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/skins/aqua/title-bg.gif?rev=586916&view=auto
==============================================================================
Binary file - no diff available.

Propchange: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/skins/aqua/title-bg.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/skins/aqua/today-bg.gif
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/skins/aqua/today-bg.gif?rev=586916&view=auto
==============================================================================
Binary file - no diff available.

Propchange: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/jscalendar-1.0/skins/aqua/today-bg.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: tapestry/tapestry5/trunk/tapestry-core/src/site/apt/index.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/site/apt/index.apt?rev=586916&r1=586915&r2=586916&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/site/apt/index.apt (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/site/apt/index.apt Sun Oct 21 09:23:51 2007
@@ -13,6 +13,8 @@
   Progress on Tapestry 5 is really taking off. This space lists some cool new features that have been added
   recently.
   
+  * We finally have a DateField component, built on top of the {{{http://www.dynarch.com/projects/calendar/}dynarch.com DHTML/JavaScript Calendar}}.
+  
   * The Grid component may now be used inside a Form.
   
   * Tapestry templates now use the extension .tml (not .html). Page templates in the context are now stored at the root, not under WEB-INF.

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/BeanEditDateDemo.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/BeanEditDateDemo.tml?rev=586916&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/BeanEditDateDemo.tml (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/BeanEditDateDemo.tml Sun Oct 21 09:23:51 2007
@@ -0,0 +1,13 @@
+<html t:type="Border"
+  xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+
+  <h1>BeanEditor Date Demo</h1>
+
+  <t:beaneditform t:id="reminder" />
+
+  <hr />
+
+  <t:actionlink t:id="clear">clear</t:actionlink>
+
+
+</html>

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DateFieldDemo.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DateFieldDemo.tml?rev=586916&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DateFieldDemo.tml (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DateFieldDemo.tml Sun Oct 21 09:23:51 2007
@@ -0,0 +1,33 @@
+<html t:type="Border"
+  xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+
+  <h1>DateField Demo</h1>
+
+  <t:form>
+    <t:errors />
+
+    <div class="t-beaneditor">
+
+      <div class="t-beaneditor-row">
+        <t:label for="birthday" />
+        <t:datefield t:id="birthday" />
+      </div>
+
+
+      <div class="t-beaneditor-row">
+        <input type="submit" value="Go" />
+      </div>
+
+    </div>
+  </t:form>
+
+  <t:if test="birthday">
+    <hr />
+    <p>
+      Birthday:
+      [<t:output value="birthday" format="dateFormat" />]
+    </p>
+  </t:if>
+
+
+</html>

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/ShowBirthdayReminder.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/ShowBirthdayReminder.tml?rev=586916&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/ShowBirthdayReminder.tml (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/ShowBirthdayReminder.tml Sun Oct 21 09:23:51 2007
@@ -0,0 +1,8 @@
+<html t:type="Border"
+  xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
+
+  <h1>BeanEditor Date Demo</h1>
+
+  <t:beandisplay object="reminder" />
+
+</html>

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/Start.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/Start.tml?rev=586916&r1=586915&r2=586916&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/Start.tml (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/Start.tml Sun Oct 21 09:23:51 2007
@@ -110,8 +110,12 @@
             -- Loops and Submit inside Form, volatile mode
           </li>
           <li>
-<t:pagelink page="MissingTemplate">Missing Template Demo</t:pagelink> -- Demo for what happens when a template is not found for a page.
-</li>
+            <t:pagelink page="MissingTemplate">
+              Missing Template Demo
+            </t:pagelink>
+            -- Demo for what happens when a template is not found for a
+            page.
+          </li>
         </ul>
       </td>
       <td>
@@ -257,6 +261,17 @@
             <t:pagelink page="GridFormDemo">Grid Form Demo</t:pagelink>
             -- Grid operating inside a Form
           </li>
+          <li>
+            <t:pagelink page="DateFieldDemo">DateField Demo</t:pagelink>
+            -- using DateField by itself on a page
+          </li>
+          <li>
+            <t:pagelink page="BeanEditDateDemo">
+              BeanEditor / Date Demo
+            </t:pagelink>
+            -- Use of date properties inside BeanEditor and BeanDisplay
+          </li>
+
         </ul>
       </td>
     </tr>

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/DateFieldTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/DateFieldTest.java?rev=586916&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/DateFieldTest.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/corelib/components/DateFieldTest.java Sun Oct 21 09:23:51 2007
@@ -0,0 +1,87 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.corelib.components;
+
+import java.text.SimpleDateFormat;
+
+import org.apache.tapestry.ComponentResources;
+import org.apache.tapestry.ioc.Location;
+import org.apache.tapestry.ioc.Messages;
+import org.apache.tapestry.ioc.internal.util.TapestryException;
+import org.apache.tapestry.test.TapestryTestCase;
+import org.testng.annotations.Test;
+
+public class DateFieldTest extends TapestryTestCase
+{
+
+    @Test
+    public void convert_symbols_success() throws Exception
+    {
+        Messages messages = messagesFor(DateField.class);
+
+        DateField df = new DateField();
+        df.injectMessages(messages);
+
+        SimpleDateFormat format = df.toJavaDateFormat();
+
+        assertEquals(format.toPattern(), "MM/dd/yy");
+    }
+
+    @Test
+    public void convert_symbol_non_default() throws Exception
+    {
+        Messages messages = messagesFor(DateField.class);
+
+        DateField df = new DateField();
+        df.injectMessages(messages);
+        df.injectFormat("%d %b %Y");
+
+        SimpleDateFormat format = df.toJavaDateFormat();
+
+        assertEquals(format.toPattern(), "dd MMM yyyy");
+    }
+
+    @Test
+    public void unknown_symbol() throws Exception
+    {
+        Messages messages = messagesFor(DateField.class);
+        ComponentResources resources = mockComponentResources();
+        Location l = mockLocation();
+
+        train_getLocation(resources, l);
+
+        DateField df = new DateField();
+        df.injectMessages(messages);
+        df.injectFormat("%d %b %Z");
+        df.injectResources(resources);
+
+        replay();
+
+        try
+        {
+            df.toJavaDateFormat();
+            unreachable();
+        }
+        catch (TapestryException ex)
+        {
+            assertEquals(
+                    ex.getMessage(),
+                    "Unknown or unsupported symbol '%Z' (in format '%d %b %Z').");
+            assertSame(ex.getLocation(), l);
+        }
+
+        verify();
+    }
+}

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java?rev=586916&r1=586915&r2=586916&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/IntegrationTests.java Sun Oct 21 09:23:51 2007
@@ -266,7 +266,7 @@
         type("userName", "howard");
         type("password", "wrong-password");
 
-        clickAndWait("//input[@type='submit']");
+        clickAndWait(SUBMIT);
 
         assertFieldValue("userName", "howard");
         // Verify that password fields do not render a non-blank password, even when it is known.
@@ -277,7 +277,7 @@
 
         type("password", "tapestry");
 
-        clickAndWait("//input[@type='submit']");
+        clickAndWait(SUBMIT);
 
         assertTextPresent("You have provided the correct user name and password.");
     }
@@ -317,7 +317,7 @@
     {
         start("ValidForm");
 
-        clickAndWait("//input[@type='submit']");
+        clickAndWait(SUBMIT);
         assertTextPresent("You must provide a value for Email.");
         // is an overridden validation error message:
         assertTextPresent("Please provide a detailed description of the incident.");
@@ -333,7 +333,7 @@
         type("message", "Show me the money!");
         type("hours", "foo");
 
-        clickAndWait("//input[@type='submit']");
+        clickAndWait(SUBMIT);
 
         assertTextPresent("[false]");
         assertTextPresent("The input value 'foo' is not parseable as an integer value.");
@@ -342,7 +342,7 @@
 
         type("hours", " 19 ");
         click("//input[@id='urgent']");
-        clickAndWait("//input[@type='submit']");
+        clickAndWait(SUBMIT);
 
         // Make sure the decoration went away.
 
@@ -404,7 +404,7 @@
         select("department", "R&D");
         click("urgent");
 
-        clickAndWait("//input[@type='submit']");
+        clickAndWait(SUBMIT);
 
         assertFieldValue("email", "foo@bar.baz");
         assertFieldValue("message", "Message for you, sir!");
@@ -523,10 +523,8 @@
     @Test
     public void bean_editor()
     {
-        String submitButton = "//input[@type='submit']";
-
         start("BeanEditor Demo", "Clear Data");
-        clickAndWait(submitButton);
+        clickAndWait(SUBMIT);
 
         assertTextPresent(
                 "(First Name is Required)",
@@ -548,7 +546,7 @@
         select("sex", "label=Martian");
         click("citizen");
 
-        clickAndWait(submitButton);
+        clickAndWait(SUBMIT);
 
         assertTextPresent(
                 "You must provide at least 3 characters for First Name.",
@@ -559,7 +557,7 @@
         type("lastName", "Lewis Ship");
         type("birthYear", "1966");
 
-        clickAndWait(submitButton);
+        clickAndWait(SUBMIT);
 
         // The XPath support is too week for //div[@class='t-beandisplay-value'][%d], so we
         // just look for the text itself.
@@ -797,7 +795,7 @@
 
         // Notice: click, not click and wait.
 
-        click("//input[@type='submit']");
+        click(SUBMIT);
 
         assertTextSeries(
                 "//li[%d]",
@@ -809,14 +807,14 @@
         type("firstName", "Howard");
         type("lastName", "Lewis Ship");
         type("birthYear", "1000");
-        click("//input[@type='submit']");
+        click(SUBMIT);
 
         assertText("//li", "Year of Birth requires a value of at least 1900.");
 
         type("birthYear", "1966");
         click("citizen");
 
-        clickAndWait("//input[@type='submit']");
+        clickAndWait(SUBMIT);
 
         assertTextPresent("Howard", "Lewis Ship", "1966", "U. S. Citizen");
     }
@@ -916,7 +914,7 @@
         addSelection("languages:avail", "label=Javascript");
         click("languages:select");
 
-        clickAndWait("//input[@type='submit']");
+        clickAndWait(SUBMIT);
         assertTextPresent("Selected Languages: [HASKELL, JAVASCRIPT]");
 
         addSelection("languages", "label=Javascript");
@@ -933,12 +931,12 @@
 
         click("languages:select");
 
-        clickAndWait("//input[@type='submit']");
+        clickAndWait(SUBMIT);
 
         assertTextPresent("[ERLANG, HASKELL, JAVA, LISP, ML, PERL, PYTHON, RUBY]");
 
         check("reorder");
-        clickAndWait("//input[@type='submit']");
+        clickAndWait(SUBMIT);
 
         addSelection("languages", "label=Ruby");
 
@@ -950,7 +948,7 @@
 
         click("languages:down");
 
-        clickAndWait("//input[@type='submit']");
+        clickAndWait(SUBMIT);
 
         assertTextPresent("[ERLANG, RUBY, HASKELL, JAVA, LISP, ML, PYTHON, PERL]");
     }
@@ -1026,7 +1024,7 @@
     {
         start("RadioDemo");
 
-        String update = "//input[@type='submit']";
+        String update = SUBMIT;
 
         // in a loop ...
         click("//label[.='Accounting']");
@@ -1052,7 +1050,7 @@
     {
         start("Regexp Demo");
 
-        String update = "//input[@type='submit']";
+        String update = SUBMIT;
 
         type("zipCode", "abc");
 
@@ -1110,7 +1108,7 @@
         type("title_1", "Pay Phone Bill");
         select("urgency_1", "Low");
 
-        clickAndWait("//input[@type='submit']");
+        clickAndWait(SUBMIT);
 
         assertFieldValueSeries("title_%d", 0, "Cure Cancer", "Pay Phone Bill");
         assertFieldValueSeries("urgency_%d", 0, "HIGH", "LOW");
@@ -1122,5 +1120,42 @@
         start("Missing Template Demo");
 
         assertTextPresent("Page MissingTemplate did not generate any markup when rendered. This could be because its template file could not be located, or because a render phase method in the page prevented rendering.");
+    }
+
+    /**
+     * This can test some output and parsing capability of the DateField component, but not the
+     * interesting client-side behavior.
+     */
+    @Test
+    public void basic_datefield()
+    {
+        start("DateField Demo");
+
+        type("birthday", "12/24/66");
+
+        clickAndWait(SUBMIT);
+
+        assertTextPresent("[12/24/1966]");
+
+        assertFieldValue("birthday", "12/24/66");
+    }
+
+    /**
+     * This also checks that the date type is displayed correctly by BeanDisplay and Grid.
+     */
+    @Test
+    public void date_field_inside_bean_editor()
+    {
+        start("BeanEditor / Date Demo", "clear");
+
+        type("name", "Howard Lewis Ship");
+        type("date", "12/24/66");
+
+        clickAndWait(SUBMIT);
+
+        // Notice the date output format; that is controlled by the date Block on the
+        // PropertyDisplayBlocks page.
+
+        assertTextPresent("Howard Lewis Ship", "Dec 24, 1966");
     }
 }

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/data/BirthdayReminder.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/data/BirthdayReminder.java?rev=586916&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/data/BirthdayReminder.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/data/BirthdayReminder.java Sun Oct 21 09:23:51 2007
@@ -0,0 +1,49 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.integration.app1.data;
+
+import java.util.Date;
+
+import org.apache.tapestry.beaneditor.Validate;
+
+public class BirthdayReminder
+{
+    private String _name;
+
+    private Date _date;
+
+    @Validate("required")
+    public String getName()
+    {
+        return _name;
+    }
+
+    @Validate("required")
+    public Date getDate()
+    {
+        return _date;
+    }
+
+    public void setName(String name)
+    {
+        _name = name;
+    }
+
+    public void setDate(Date date)
+    {
+        _date = date;
+    }
+
+}

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/BeanEditDateDemo.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/BeanEditDateDemo.java?rev=586916&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/BeanEditDateDemo.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/BeanEditDateDemo.java Sun Oct 21 09:23:51 2007
@@ -0,0 +1,40 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.integration.app1.pages;
+
+import org.apache.tapestry.integration.app1.data.BirthdayReminder;
+
+import org.apache.tapestry.annotations.ApplicationState;
+
+public class BeanEditDateDemo
+{
+    @ApplicationState
+    private BirthdayReminder _reminder;
+
+    public BirthdayReminder getReminder()
+    {
+        return _reminder;
+    }
+
+    void onActionFromClear()
+    {
+        _reminder = null;
+    }
+
+    Object onSuccess()
+    {
+        return ShowBirthdayReminder.class;
+    }
+}

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/DateFieldDemo.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/DateFieldDemo.java?rev=586916&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/DateFieldDemo.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/DateFieldDemo.java Sun Oct 21 09:23:51 2007
@@ -0,0 +1,44 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.integration.app1.pages;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import org.apache.tapestry.annotations.Persist;
+import org.apache.tapestry.beaneditor.Validate;
+
+public class DateFieldDemo
+{
+    @Persist
+    private Date _birthday;
+
+    @Validate("required")
+    public Date getBirthday()
+    {
+        return _birthday;
+    }
+
+    public void setBirthday(Date birthday)
+    {
+        _birthday = birthday;
+    }
+
+    public DateFormat getDateFormat()
+    {
+        return new SimpleDateFormat("MM/dd/yyyy");
+    }
+}

Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/ShowBirthdayReminder.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/ShowBirthdayReminder.java?rev=586916&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/ShowBirthdayReminder.java (added)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/ShowBirthdayReminder.java Sun Oct 21 09:23:51 2007
@@ -0,0 +1,29 @@
+// Copyright 2007 The Apache Software Foundation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package org.apache.tapestry.integration.app1.pages;
+
+import org.apache.tapestry.annotations.ApplicationState;
+import org.apache.tapestry.integration.app1.data.BirthdayReminder;
+
+public class ShowBirthdayReminder
+{
+    @ApplicationState
+    private BirthdayReminder _reminder;
+
+    public BirthdayReminder getReminder()
+    {
+        return _reminder;
+    }
+}

Modified: tapestry/tapestry5/trunk/tapestry-test/src/main/java/org/apache/tapestry/test/AbstractIntegrationTestSuite.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-test/src/main/java/org/apache/tapestry/test/AbstractIntegrationTestSuite.java?rev=586916&r1=586915&r2=586916&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-test/src/main/java/org/apache/tapestry/test/AbstractIntegrationTestSuite.java (original)
+++ tapestry/tapestry5/trunk/tapestry-test/src/main/java/org/apache/tapestry/test/AbstractIntegrationTestSuite.java Sun Oct 21 09:23:51 2007
@@ -57,6 +57,8 @@
     // root.
     public static final String BASE_URL = String.format("http://localhost:%d/", JETTY_PORT);
 
+    public static final String SUBMIT = "//input[@type='submit']";
+
     private final String _webappRoot;
 
     private JettyRunner _jettyRunner;

Modified: tapestry/tapestry5/trunk/tapestry-upload/src/main/java/org/apache/tapestry/upload/components/Upload.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-upload/src/main/java/org/apache/tapestry/upload/components/Upload.java?rev=586916&r1=586915&r2=586916&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-upload/src/main/java/org/apache/tapestry/upload/components/Upload.java (original)
+++ tapestry/tapestry5/trunk/tapestry-upload/src/main/java/org/apache/tapestry/upload/components/Upload.java Sun Oct 21 09:23:51 2007
@@ -145,7 +145,7 @@
 
         _resources.renderInformalParameters(writer);
 
-        getValidationDecorator().insideField(this);
+        decorateInsideField();
     }
 
     public void afterRender(MarkupWriter writer)
@@ -172,7 +172,7 @@
     {
         // We have our copy ...
         _formSupport = formSupport;
-        
+
         // As does AbstractField
         setFormSupport(formSupport);
     }