You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ri...@apache.org on 2005/02/23 01:27:41 UTC

svn commit: r154918 - in incubator/beehive/trunk/netui: src/tags-html/org/apache/beehive/netui/tags/html/ test/webapps/drt/coreWeb/tags/disableOnClick/ test/webapps/drt/coreWeb/tags/disableSecondClick/ test/webapps/drt/testRecorder/config/ test/webapps/drt/testRecorder/tests/

Author: rich
Date: Tue Feb 22 16:27:38 2005
New Revision: 154918

URL: http://svn.apache.org/viewcvs?view=rev&rev=154918
Log:
Fix for http://issues.apache.org/jira/browse/BEEHIVE-345 : Suggest renaming attribute "disableOnClick"

DRT/BVT: netui (WinXP)
BB: self (linux)


Added:
    incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/disableSecondClick/
      - copied from r154801, incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/disableOnClick/
    incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DisableSecondClick.xml
      - copied, changed from r154801, incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DisableOnClick.xml
Removed:
    incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/disableOnClick/
    incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DisableOnClick.xml
Modified:
    incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java
    incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Button.java
    incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/disableSecondClick/Controller.jpf
    incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/disableSecondClick/index.jsp
    incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml

Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java?view=diff&r1=154917&r2=154918
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/AnchorBase.java Tue Feb 22 16:27:38 2005
@@ -45,7 +45,7 @@
     private Form _form;                         // the nearest form
     private boolean _formSubmit = false;        // should the anchor submit an enclosing form?
     private PopupSupport _popupSupport = null;  // popup support, if the popup attribute is set to true
-    private boolean _disableOnClick = false;    // When clicked, this anchor will disable itself after being clicked.
+    private boolean _disableSecondClick = false;    // When clicked, this anchor will disable itself after being clicked.
 
     /**
      * Base support for the attribute tag.  This is overridden to prevent setting the <code>href</code>
@@ -200,18 +200,18 @@
     
     /**
      * When true, this anchor will disable itself after being clicked.
-     * @param disableOnClick - when true, this anchor will disable itself after being clicked.
-     * @jsptagref.attributedescription Boolean.  If <code>disableOnClick</code> is set to true,
+     * @param disableSecondClick - when true, this anchor will disable itself after being clicked.
+     * @jsptagref.attributedescription Boolean.  If <code>disableSecondClick</code> is set to true,
      * the anchor will disable itself after being clicked.
      * @jsptagref.databindable true
-     * @jsptagref.attributesyntaxvalue <i>boolean_disableOnClick</i>
+     * @jsptagref.attributesyntaxvalue <i>boolean_disableSecondClick</i>
      * @netui:attribute required="false" rtexprvalue="true" type="boolean"
      * description="When true, this anchor will disable itself after being clicked."
      * @netui.tldx:attribute
      */
-    public void setDisableOnClick(boolean disableOnClick)
+    public void setDisableSecondClick(boolean disableSecondClick)
     {
-        _disableOnClick = disableOnClick;
+        _disableSecondClick = disableSecondClick;
     }
 
     
@@ -454,7 +454,7 @@
         if (onclick == null) {
             if (_formSubmit && formAction != null) {
                 String realFormName = getFormId();
-                String key = (_disableOnClick ? "anchorDisableAndSubmitFormAction" : "anchorFormSubmitAction");
+                String key = (_disableSecondClick ? "anchorDisableAndSubmitFormAction" : "anchorFormSubmitAction");
                 String entry = ScriptRequestState.getString(key, new Object[]{realFormName, _state.href});
                 _state.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, ONCLICK, entry);
                 // Jira 299
@@ -463,7 +463,7 @@
                 if (_form != null)
                     _form.insureRealId();
             }
-            else if (_disableOnClick) {
+            else if (_disableSecondClick) {
                 String entry = ScriptRequestState.getString("anchorDisableAction", null);
                 _state.registerAttribute(AbstractHtmlState.ATTR_JAVASCRIPT, ONCLICK, entry);
             }
@@ -610,7 +610,7 @@
         _form = null;
         _formSubmit = false;
         _popupSupport = null;
-        _disableOnClick = false;
+        _disableSecondClick = false;
     }
 
     public PopupSupport getPopupSupport()

Modified: incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Button.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Button.java?view=diff&r1=154917&r2=154918
==============================================================================
--- incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Button.java (original)
+++ incubator/beehive/trunk/netui/src/tags-html/org/apache/beehive/netui/tags/html/Button.java Tue Feb 22 16:27:38 2005
@@ -81,12 +81,12 @@
 
     private InputSubmitTag.State _state = new InputSubmitTag.State();
 
-    private String _action;                     // The action which will override the action on the form
-    private String _value;                      // The text of the button (this will override any body text).
-    private Map _params;                        // Any parameters to the submit
-    private String _targetScope;                // Target page flow scope; see comments on setTargetScope()
-    private PopupSupport _popupSupport = null;  // popup support, if the popup attribute is set to true
-    private boolean _disableOnClick = false;    // When clicked, this button will disable itself before submitting.
+    private String _action;                      // The action which will override the action on the form
+    private String _value;                       // The text of the button (this will override any body text).
+    private Map _params;                         // Any parameters to the submit
+    private String _targetScope;                 // Target page flow scope; see comments on setTargetScope()
+    private PopupSupport _popupSupport = null;   // popup support, if the popup attribute is set to true
+    private boolean _disableSecondClick = false; // When clicked, this button will disable itself before submitting.
 
     /**
      * Return the name of the Tag.
@@ -215,18 +215,18 @@
     
     /**
      * When true, this button will disable itself before submitting.
-     * @param disableOnClick - when true, this button will disable itself before submitting.
-     * @jsptagref.attributedescription Boolean.  If <code>disableOnClick</code> is set to true,
+     * @param disableSecondClick - when true, this button will disable itself before submitting.
+     * @jsptagref.attributedescription Boolean.  If <code>disableSecondClick</code> is set to true,
      * the button will disable itself before submitting.
      * @jsptagref.databindable true
-     * @jsptagref.attributesyntaxvalue <i>boolean_disableOnClick</i>
+     * @jsptagref.attributesyntaxvalue <i>boolean_disableSecondClick</i>
      * @netui:attribute required="false" rtexprvalue="true" type="boolean"
      * description="When true, this button will disable itself before submitting."
      * @netui.tldx:attribute
      */
-    public void setDisableOnClick(boolean disableOnClick)
+    public void setDisableSecondClick(boolean disableSecondClick)
     {
-        _disableOnClick = disableOnClick;
+        _disableSecondClick = disableSecondClick;
     }
 
     /**
@@ -351,7 +351,7 @@
         
         // if the user overrides the onclick we will ignore this
         if (getOnClick() == null) {
-            if (_disableOnClick) {
+            if (_disableSecondClick) {
                 Form parentForm = getNearestForm();
                 String href = getActionUrl(request, response);
                 String entry;
@@ -450,7 +450,7 @@
         _params = null;
         _targetScope = null;
         _popupSupport = null;
-        _disableOnClick = false;
+        _disableSecondClick = false;
     }
 
     /* ==================================================================

Modified: incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/disableSecondClick/Controller.jpf
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/disableSecondClick/Controller.jpf?view=diff&r1=154801&r2=154918
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/disableSecondClick/Controller.jpf (original)
+++ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/disableSecondClick/Controller.jpf Tue Feb 22 16:27:38 2005
@@ -1,4 +1,4 @@
-package tags.disableOnClick;
+package tags.disableSecondClick;
 
 import org.apache.beehive.netui.pageflow.*;
 import org.apache.beehive.netui.pageflow.annotations.*;

Modified: incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/disableSecondClick/index.jsp
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/disableSecondClick/index.jsp?view=diff&r1=154801&r2=154918
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/disableSecondClick/index.jsp (original)
+++ incubator/beehive/trunk/netui/test/webapps/drt/coreWeb/tags/disableSecondClick/index.jsp Tue Feb 22 16:27:38 2005
@@ -17,27 +17,27 @@
         <netui:form action="someAction">
             <netui:button value="submit"/>
             <br/>
-            <netui:button value="submit (disableOnClick)" disableOnClick="true"/>
+            <netui:button value="submit (disableSecondClick)" disableSecondClick="true"/>
             <br/>
             <br/>
             <netui:button value="submit with action override" action="anotherAction"/>
             <br/>
-            <netui:button value="submit with action override (disableOnClick)" action="anotherAction" disableOnClick="true"/>
+            <netui:button value="submit with action override (disableSecondClick)" action="anotherAction" disableSecondClick="true"/>
             <br/>
             <br/>
             <netui:anchor formSubmit="true">submit</netui:anchor>
             <br/>
-            <netui:anchor formSubmit="true" disableOnClick="true">submit (disableOnClick)</netui:anchor>
+            <netui:anchor formSubmit="true" disableSecondClick="true">submit (disableSecondClick)</netui:anchor>
         </netui:form>
 
         <netui:anchor action="someAction">non-submit</netui:anchor>
         <br/>
-        <netui:anchor action="someAction" disableOnClick="true">non-submit (disableOnClick)</netui:anchor>
+        <netui:anchor action="someAction" disableSecondClick="true">non-submit (disableSecondClick)</netui:anchor>
         <br/>
         <br/>
         non-submit: <netui:imageAnchor action="someAction" src="cool.gif"/>
         <br/>
-        non-submit (disableOnClick): <netui:imageAnchor action="someAction" disableOnClick="true" src="cool.gif"/>
+        non-submit (disableSecondClick): <netui:imageAnchor action="someAction" disableSecondClick="true" src="cool.gif"/>
     </netui:body>
 </netui:html>
 

Modified: incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml?view=diff&r1=154917&r2=154918
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml (original)
+++ incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/config/testRecorder-tests.xml Tue Feb 22 16:27:38 2005
@@ -3265,7 +3265,7 @@
          </features>
       </test>
       <test>
-         <name>DisableOnClick</name>
+         <name>DisableSecondClick</name>
          <description>Test of the rendered JavaScript for disabling anchors, imageAnchors and buttons when they are clicked.</description>
          <webapp>coreWeb</webapp>
          <categories>

Copied: incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DisableSecondClick.xml (from r154801, incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DisableOnClick.xml)
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DisableSecondClick.xml?view=diff&rev=154918&p1=incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DisableOnClick.xml&r1=154801&p2=incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DisableSecondClick.xml&r2=154918
==============================================================================
--- incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DisableOnClick.xml (original)
+++ incubator/beehive/trunk/netui/test/webapps/drt/testRecorder/tests/DisableSecondClick.xml Tue Feb 22 16:27:38 2005
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <ses:recorderSession xmlns:ses="http://beehive.apache.org/netui/tools/testrecorder/2004/session">
-   <ses:sessionName>DisableOnClick</ses:sessionName>
+   <ses:sessionName>DisableSecondClick</ses:sessionName>
    <ses:tester>rich</ses:tester>
    <ses:startDate>21 Feb 2005, 10:23:51.042 PM MST</ses:startDate>
    <ses:description>Test of the rendered JavaScript for disabling anchors, imageAnchors and buttons when they are clicked.</ses:description>
@@ -12,7 +12,7 @@
             <ses:protocolVersion>1.1</ses:protocolVersion>
             <ses:host>localhost</ses:host>
             <ses:port>8080</ses:port>
-            <ses:uri>/coreWeb/tags/disableOnClick/Controller.jpf</ses:uri>
+            <ses:uri>/coreWeb/tags/disableSecondClick/Controller.jpf</ses:uri>
             <ses:method>GET</ses:method>
             <ses:parameters/>
             <ses:cookies>
@@ -68,38 +68,38 @@
 &lt;html lang="en">
 
     &lt;head>
-        &lt;base href="http://localhost:8080/coreWeb/tags/disableOnClick/index.jsp">
+        &lt;base href="http://localhost:8080/coreWeb/tags/disableSecondClick/index.jsp">
     &lt;/head>
     &lt;body>
-        &lt;h3>/tags/disableOnClick/Controller.jpf&lt;/h3>
+        &lt;h3>/tags/disableSecondClick/Controller.jpf&lt;/h3>
 
         This test merely verifies that the right JavaScript is rendered; it can't actually test the disabling behavior.
         &lt;br/>
         &lt;br/>
-        &lt;form name="Netui_Form_0" id="Netui_Form_0" action="/coreWeb/tags/disableOnClick/someAction.do" method="post">
+        &lt;form name="Netui_Form_0" id="Netui_Form_0" action="/coreWeb/tags/disableSecondClick/someAction.do" method="post">
             &lt;input type="submit" value="submit">
             &lt;br/>
-            &lt;input type="submit" value="submit (disableOnClick)" onclick="button_disable_and_submit_form(this,'Netui_Form_0','/coreWeb/tags/disableOnClick/someAction.do');return false;">
+            &lt;input type="submit" value="submit (disableSecondClick)" onclick="button_disable_and_submit_form(this,'Netui_Form_0','/coreWeb/tags/disableSecondClick/someAction.do');return false;">
             &lt;br/>
             &lt;br/>
             &lt;input type="submit" name="actionOverride:anotherAction" value="submit with action override">
             &lt;br/>
-            &lt;input type="submit" name="actionOverride:anotherAction" value="submit with action override (disableOnClick)" onclick="button_disable_and_submit_form(this,'Netui_Form_0','/coreWeb/tags/disableOnClick/anotherAction.do');return false;">
+            &lt;input type="submit" name="actionOverride:anotherAction" value="submit with action override (disableSecondClick)" onclick="button_disable_and_submit_form(this,'Netui_Form_0','/coreWeb/tags/disableSecondClick/anotherAction.do');return false;">
             &lt;br/>
             &lt;br/>
-            &lt;a href="/coreWeb/tags/disableOnClick/someAction.do" onclick="anchor_submit_form('Netui_Form_0','/coreWeb/tags/disableOnClick/someAction.do');return false;">submit&lt;/a>
+            &lt;a href="/coreWeb/tags/disableSecondClick/someAction.do" onclick="anchor_submit_form('Netui_Form_0','/coreWeb/tags/disableSecondClick/someAction.do');return false;">submit&lt;/a>
             &lt;br/>
-            &lt;a href="/coreWeb/tags/disableOnClick/someAction.do" onclick="if (this.clicked) return false; anchor_submit_form('Netui_Form_0','/coreWeb/tags/disableOnClick/someAction.do'); this.clicked=true; return false;">submit (disableOnClick)&lt;/a>
+            &lt;a href="/coreWeb/tags/disableSecondClick/someAction.do" onclick="if (this.clicked) return false; anchor_submit_form('Netui_Form_0','/coreWeb/tags/disableSecondClick/someAction.do'); this.clicked=true; return false;">submit (disableSecondClick)&lt;/a>
         &lt;/form>
 
-        &lt;a href="/coreWeb/tags/disableOnClick/someAction.do">non-submit&lt;/a>
+        &lt;a href="/coreWeb/tags/disableSecondClick/someAction.do">non-submit&lt;/a>
         &lt;br/>
-        &lt;a href="/coreWeb/tags/disableOnClick/someAction.do" onclick="if (this.clicked) return false; this.clicked=true;">non-submit (disableOnClick)&lt;/a>
+        &lt;a href="/coreWeb/tags/disableSecondClick/someAction.do" onclick="if (this.clicked) return false; this.clicked=true;">non-submit (disableSecondClick)&lt;/a>
         &lt;br/>
         &lt;br/>
-        non-submit: &lt;a href="/coreWeb/tags/disableOnClick/someAction.do">&lt;img src="/coreWeb/tags/disableOnClick/cool.gif">&lt;/a>
+        non-submit: &lt;a href="/coreWeb/tags/disableSecondClick/someAction.do">&lt;img src="/coreWeb/tags/disableSecondClick/cool.gif">&lt;/a>
         &lt;br/>
-        non-submit (disableOnClick): &lt;a href="/coreWeb/tags/disableOnClick/someAction.do" onclick="if (this.clicked) return false; this.clicked=true;">&lt;img src="/coreWeb/tags/disableOnClick/cool.gif">&lt;/a>
+        non-submit (disableSecondClick): &lt;a href="/coreWeb/tags/disableSecondClick/someAction.do" onclick="if (this.clicked) return false; this.clicked=true;">&lt;img src="/coreWeb/tags/disableSecondClick/cool.gif">&lt;/a>
     &lt;script language="JavaScript" type="text/JavaScript">
 &lt;!--