You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2013/09/04 02:53:20 UTC

[2/3] git commit: Make use of FormGroup mixin Modify PropertyEditor to begin/end a Heartbeat, needed by FormGroup mixin

Make use of FormGroup mixin
Modify PropertyEditor to begin/end a Heartbeat, needed by FormGroup mixin


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/c7d47248
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/c7d47248
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/c7d47248

Branch: refs/heads/master
Commit: c7d4724836c5afeea47c22073b371b9f0515b148
Parents: 89ade37
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Sep 3 17:31:12 2013 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Sep 3 17:31:12 2013 -0700

----------------------------------------------------------------------
 .../corelib/components/PropertyEditor.java      |  9 ++++-
 .../corelib/pages/PropertyEditBlocks.tml        | 42 ++++----------------
 2 files changed, 16 insertions(+), 35 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c7d47248/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/PropertyEditor.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/PropertyEditor.java b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/PropertyEditor.java
index 7a04dc6..c79c192 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/PropertyEditor.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/PropertyEditor.java
@@ -1,4 +1,4 @@
-// Copyright 2007, 2008, 2009, 2011, 2012 The Apache Software Foundation
+// Copyright 2007-2013 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.
@@ -140,6 +140,9 @@ public class PropertyEditor
     @Environmental
     private FormSupport formSupport;
 
+    @Inject
+    private Heartbeat heartbeat;
+
     private PropertyModel propertyModel;
 
     BeanBlockSource defaultBeanBlockSource()
@@ -217,6 +220,8 @@ public class PropertyEditor
         {
         	beanValidationContext.setCurrentProperty(propertyName);
         }
+
+        heartbeat.begin();
     }
 
     /**
@@ -225,6 +230,8 @@ public class PropertyEditor
      */
     void cleanupEnvironment()
     {
+        heartbeat.end();
+
         environment.pop(PropertyEditContext.class);
     }
 

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/c7d47248/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/PropertyEditBlocks.tml
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/PropertyEditBlocks.tml b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/PropertyEditBlocks.tml
index d8e4e12..b22f161 100644
--- a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/PropertyEditBlocks.tml
+++ b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/PropertyEditBlocks.tml
@@ -1,25 +1,16 @@
-<div xml:space="default" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
+<div xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
 
     <t:block id="text">
-        <div class="form-group">
-            <t:label for="textField"/>
-            <input t:id="textField"/>
-        </div>
+        <input t:mixins="formgroup" t:id="textField"/>
     </t:block>
 
     <t:block id="number">
-        <div class="form-group">
-            <t:label for="numberField"/>
-            <input t:id="numberField" class="t-number"/>
-        </div>
+        <input t:id="numberField" t:mixins="formgroup" class="t-number"/>
     </t:block>
 
 
     <t:block id="enum">
-        <div class="form-group">
-            <t:label for="select"/>
-            <input t:id="select"/>
-        </div>
+        <input t:id="select" t:mixins="formgroup"/>
     </t:block>
 
     <t:block id="boolean">
@@ -30,40 +21,23 @@
                 ${context.label}
             </label>
         </div>
-
     </t:block>
 
     <t:block id="date">
-
-        <div class="form-group">
-            <t:label for="dateField"/>
-            <input t:id="dateField"/>
-        </div>
-
+        <input t:id="dateField" t:mixins="formgroup"/>
     </t:block>
 
     <t:block id="calendar">
-
-        <div class="form-group">
-            <t:label for="calendarField"/>
-            <input t:id="calendarField"/>
-        </div>
-
+        <input t:id="calendarField" t:mixins="formgroup"/>
     </t:block>
 
     <t:block id="password">
 
-        <div class="form-group">
-            <t:label for="passwordField"/>
-            <input t:id="passwordField"/>
-        </div>
+        <input t:id="passwordField" t:mixins="formgroup"/>
 
     </t:block>
 
     <t:block id="longtext">
-        <div class="form-group">
-            <t:label for="textarea"/>
-            <textarea t:id="textarea"/>
-        </div>
+        <textarea t:id="textarea" t:mixins="formgroup"/>
     </t:block>
 </div>
\ No newline at end of file