You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by jk...@apache.org on 2006/07/23 17:40:59 UTC

svn commit: r424757 - in /tapestry/tapestry4/trunk: src/site/xdoc/components/ tapestry-framework/src/java/org/apache/tapestry/form/

Author: jkuhnert
Date: Sun Jul 23 08:40:58 2006
New Revision: 424757

URL: http://svn.apache.org/viewvc?rev=424757&view=rev
Log:
Documentation updates, deprecated old action="" parameter and made all submit type components use deferred runnables

Modified:
    tapestry/tapestry4/trunk/src/site/xdoc/components/ImageSubmit.xml
    tapestry/tapestry4/trunk/src/site/xdoc/components/LinkSubmit.xml
    tapestry/tapestry4/trunk/src/site/xdoc/components/Submit.xml
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/AbstractSubmit.java
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/ImageSubmit.jwc
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/LinkSubmit.jwc
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/Submit.jwc

Modified: tapestry/tapestry4/trunk/src/site/xdoc/components/ImageSubmit.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/src/site/xdoc/components/ImageSubmit.xml?rev=424757&r1=424756&r2=424757&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/src/site/xdoc/components/ImageSubmit.xml (original)
+++ tapestry/tapestry4/trunk/src/site/xdoc/components/ImageSubmit.xml Sun Jul 23 08:40:58 2006
@@ -162,8 +162,14 @@
                         <td>no</td>
                         <td></td>
                         <td>
-                            An optional listener (typically specified as the name of a listener
-                            method), notified when the Submit is triggered.
+                            A listener that is notified if this component is triggered just before
+                            the form's listener, after all components enclosed by the Form have had
+                            a chance to update their properties.
+                            
+                            <p>
+                            This parameter now behaves exactly like the current action= parameter, making
+                            action deprecated.
+                            </p>
                         </td>
                     </tr>
                     <tr>
@@ -181,6 +187,10 @@
                             A listener that is notified if this component is triggered just before
                             the form's listener, after all components enclosed by the Form have had
                             a chance to update their properties.
+                            
+                            <p>
+                            This parameter is now deprecated and marked for removal in Tapestry 4.2.
+                            </p>
                         </td>
                     </tr>
                     <tr>

Modified: tapestry/tapestry4/trunk/src/site/xdoc/components/LinkSubmit.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/src/site/xdoc/components/LinkSubmit.xml?rev=424757&r1=424756&r2=424757&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/src/site/xdoc/components/LinkSubmit.xml (original)
+++ tapestry/tapestry4/trunk/src/site/xdoc/components/LinkSubmit.xml Sun Jul 23 08:40:58 2006
@@ -103,10 +103,14 @@
                         <td>no</td>
                         <td></td>
                         <td>
-                            If specified, the listener is notified. This notification occurs as the
-                            component is rewinded, i.e., prior to the Form's listener. In addition,
-                            the selected property (if bound) will be updated before the listener is
-                            notified.
+                            A listener that is notified if this component is triggered just before
+                            the form's listener, after all components enclosed by the Form have had
+                            a chance to update their properties.
+                            
+                            <p>
+                            This parameter now behaves exactly like the current action= parameter, making
+                            action deprecated.
+                            </p>
                         </td>
                     </tr>
                     <tr>
@@ -124,6 +128,10 @@
                             A listener that is notified if this component is triggered just before
                             the form's listener, after all components enclosed by the Form have had
                             a chance to update their properties.
+                            
+                            <p>
+                            This parameter is now deprecated and marked for removal in Tapestry 4.2.
+                            </p>
                         </td>
                     </tr>
                     <tr>

Modified: tapestry/tapestry4/trunk/src/site/xdoc/components/Submit.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/src/site/xdoc/components/Submit.xml?rev=424757&r1=424756&r2=424757&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/src/site/xdoc/components/Submit.xml (original)
+++ tapestry/tapestry4/trunk/src/site/xdoc/components/Submit.xml Sun Jul 23 08:40:58 2006
@@ -144,15 +144,13 @@
                         <td>no</td>
                         <td></td>
                         <td>
-                            An optional listener (typically specified as the name of a listener
-                            method), notified when the Submit is triggered.
+                            A listener that is notified if this component is triggered just before
+                            the form's listener, after all components enclosed by the Form have had
+                            a chance to update their properties.
                             
                             <p>
-                            This parameter should <strong>not</strong> be used in the majority of cases as the
-                            listener is notified before all form data has been captured on the server. Only use
-                            this when you know you are going to redirect or do some other cancelling sort of action
-                            that isn't likely to alter form state. Use <em>action</em> as your preferred listener
-                            method parameter.
+                            This parameter now behaves exactly like the current action= parameter, making
+                            action deprecated.
                             </p>
                         </td>
                     </tr>
@@ -173,8 +171,7 @@
                             a chance to update their properties.
                             
                             <p>
-                            If you are going to notify a listener, this is probably the parameter you want 
-                            to bind to.
+                            This parameter is now deprecated and marked for removal in Tapestry 4.2.
                             </p>
                         </td>
                     </tr>

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/AbstractSubmit.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/AbstractSubmit.java?rev=424757&r1=424756&r2=424757&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/AbstractSubmit.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/AbstractSubmit.java Sun Jul 23 08:40:58 2006
@@ -76,10 +76,19 @@
             }
         }
 
-        // Invoke 'listener' now, but defer 'action' for later
-        if (listener != null)
-            listenerInvoker.invokeListener(listener, AbstractSubmit.this, cycle);
-
+        // Defer 'listener' for later
+        if (listener != null) {
+            Runnable notify = new Runnable()
+            {
+                public void run()
+                {
+                    listenerInvoker.invokeListener(listener, AbstractSubmit.this, cycle);
+                }
+            };
+            
+            form.addDeferredRunnable(notify);
+        }
+        
         if (action != null) {
             Runnable notify = new Runnable()
             {
@@ -96,7 +105,12 @@
     /** parameter. */
     public abstract IActionListener getListener();
 
-    /** parameter. */
+    /**
+     * Parameter for which listener to call when submitted.
+     * 
+     * @deprecated To be completely removed in 4.2, use {@link #getListener()} instead.
+     * @return
+     */
     public abstract IActionListener getAction();
 
     /** parameter. */

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/ImageSubmit.jwc
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/ImageSubmit.jwc?rev=424757&r1=424756&r2=424757&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/ImageSubmit.jwc (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/ImageSubmit.jwc Sun Jul 23 08:40:58 2006
@@ -57,11 +57,13 @@
   
   <parameter name="listener">
   	<description>
-  	Notified when the button is clicked.
+  	A listener that is notified if this component is triggered
+    just before the form's listener, after all components 
+    enclosed by the Form have had a chance to update their properties.
   	</description>
   </parameter>
   
-  <parameter name="action">
+  <parameter name="action" deprecated="yes">
       <description>
           A listener that is notified if this component is triggered
           just before the form's listener, after all components 

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/LinkSubmit.jwc
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/LinkSubmit.jwc?rev=424757&r1=424756&r2=424757&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/LinkSubmit.jwc (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/LinkSubmit.jwc Sun Jul 23 08:40:58 2006
@@ -32,16 +32,20 @@
     
   <parameter name="listener">
       <description>
-          A listener that is notified if this component is triggered.
+          A listener that is notified if this component is triggered
+          just before the form's listener, after all components 
+          enclosed by the Form have had a chance to update their properties.
       </description>
   </parameter>
-  <parameter name="action">
+  
+  <parameter name="action" deprecated="yes">
       <description>
           A listener that is notified if this component is triggered
           just before the form's listener, after all components 
           enclosed by the Form have had a chance to update their properties.
       </description>
   </parameter>
+  
   <parameter name="parameters">
     <description>
     An object, or list of objects, gathered when the link is triggered and 

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/Submit.jwc
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/Submit.jwc?rev=424757&r1=424756&r2=424757&view=diff
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/Submit.jwc (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/form/Submit.jwc Sun Jul 23 08:40:58 2006
@@ -52,10 +52,12 @@
   </parameter>
   <parameter name="listener">
       <description>
-          A listener that is notified if this component is triggered.
+          A listener that is notified if this component is triggered
+          just before the form's listener, after all components 
+          enclosed by the Form have had a chance to update their properties.
       </description>
   </parameter>
-  <parameter name="action">
+  <parameter name="action" deprecated="yes">
       <description>
           A listener that is notified if this component is triggered
           just before the form's listener, after all components