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 2008/04/15 02:03:40 UTC

svn commit: r648072 - in /tapestry/tapestry5/trunk/tapestry-core/src: main/java/org/apache/tapestry/corelib/components/BeanEditForm.java test/app1/ZoneDemo.tml test/java/org/apache/tapestry/integration/app1/pages/ZoneDemo.java

Author: hlship
Date: Mon Apr 14 17:03:39 2008
New Revision: 648072

URL: http://svn.apache.org/viewvc?rev=648072&view=rev
Log:
TAPESTRY-2280: Add a zone parameter to the BeanEditForm component

Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanEditForm.java
    tapestry/tapestry5/trunk/tapestry-core/src/test/app1/ZoneDemo.tml
    tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/ZoneDemo.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanEditForm.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanEditForm.java?rev=648072&r1=648071&r2=648072&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanEditForm.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/BeanEditForm.java Mon Apr 14 17:03:39 2008
@@ -92,7 +92,14 @@
     @Parameter
     private boolean _clientValidation = true;
 
-    @Component(parameters = "clientValidation=inherit:clientValidation")
+    /**
+     * Binding the zone parameter will cause the form submission to be handled as an Ajax request that updates the
+     * indicated zone.  Often a BeanEditForm will update the same zone that contains it.
+     */
+    @Parameter(defaultPrefix = TapestryConstants.LITERAL_BINDING_PREFIX)
+    private String _zone;
+
+    @Component(parameters = { "clientValidation=inherit:clientValidation", "zone=inherit:zone" })
     private Form _form;
 
     @InjectComponent
@@ -172,4 +179,5 @@
     {
         _form.recordError(errorMessage);
     }
+
 }

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/ZoneDemo.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/ZoneDemo.tml?rev=648072&r1=648071&r2=648072&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/ZoneDemo.tml (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/ZoneDemo.tml Mon Apr 14 17:03:39 2008
@@ -12,21 +12,11 @@
     </t:zone>
 
     <t:block id="registrationForm">
-        <form t:id="form" zone="output">
 
-            <t:errors/>
 
-            <div class="t-beaneditor">
+        <t:beaneditform t:id="form" object="registration" zone="output"/>
 
-                <t:beaneditor t:id="registration"/>
-
-                <div class="t-beaneditor-row">
-                    <input type="submit" class="t-beaneditor-submit" value="Update"/>
-                    <t:actionlink t:id="clear" zone="output">clear</t:actionlink>
-                </div>
-            </div>
-
-        </form>
+        <t:actionlink t:id="clear" zone="output">clear</t:actionlink>
 
     </t:block>
 

Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/ZoneDemo.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/ZoneDemo.java?rev=648072&r1=648071&r2=648072&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/ZoneDemo.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/integration/app1/pages/ZoneDemo.java Mon Apr 14 17:03:39 2008
@@ -17,7 +17,7 @@
 import org.apache.tapestry.Block;
 import org.apache.tapestry.annotations.ApplicationState;
 import org.apache.tapestry.annotations.Component;
-import org.apache.tapestry.corelib.components.Form;
+import org.apache.tapestry.corelib.components.BeanEditForm;
 import org.apache.tapestry.integration.app1.data.RegistrationData;
 import org.apache.tapestry.ioc.annotations.Inject;
 import org.apache.tapestry.json.JSONObject;
@@ -26,7 +26,7 @@
 public class ZoneDemo
 {
     @Component
-    private Form _form;
+    private BeanEditForm _form;
 
     @Inject
     private Logger _logger;