[Commits] r1339 - in core/tags/geoext/release-0.5: lib lib/GeoExt/widgets/form tests/lib/GeoExt/widgets/form

commits at geoext.org commits at geoext.org
Thu Aug 27 09:00:12 CEST 2009


Author: pgiraud
Date: 2009-08-27 09:00:12 +0200 (Thu, 27 Aug 2009)
New Revision: 1339

Modified:
   core/tags/geoext/release-0.5/lib/
   core/tags/geoext/release-0.5/lib/GeoExt/widgets/form/BasicForm.js
   core/tags/geoext/release-0.5/lib/GeoExt/widgets/form/SearchAction.js
   core/tags/geoext/release-0.5/tests/lib/GeoExt/widgets/form/SearchAction.html
Log:
reverted to 1337, commit for #146 was done in the wrong tag, my bad


Property changes on: core/tags/geoext/release-0.5/lib
___________________________________________________________________
Name: svn:mergeinfo
   - 

Modified: core/tags/geoext/release-0.5/lib/GeoExt/widgets/form/BasicForm.js
===================================================================
--- core/tags/geoext/release-0.5/lib/GeoExt/widgets/form/BasicForm.js	2009-08-26 14:30:31 UTC (rev 1338)
+++ core/tags/geoext/release-0.5/lib/GeoExt/widgets/form/BasicForm.js	2009-08-27 07:00:12 UTC (rev 1339)
@@ -35,20 +35,6 @@
      */
     protocol: null,
 
-    /**
-     * private: property[prevResponse]
-     * ``OpenLayers.Protocol.Response`` The response return by a call to
-     *  protocol.read method.
-     */
-    prevResponse: null,
-
-    /**
-     * api: config[autoAbort]
-     * ``Boolean`` Tells if pending requests should be aborted
-     *      when a new action is performed.
-     */
-    autoAbort: true,
-
     /** api: method[doAction]
      *  :param action: ``String or Ext.form.Action`` Either the name
      *      of the action or a ``Ext.form.Action`` instance.
@@ -61,10 +47,7 @@
      */
     doAction: function(action, options) {
         if(action == "search") {
-            options = Ext.applyIf(options || {}, {
-                protocol: this.protocol,
-                abortPrevious: this.autoAbort
-            });
+            options = Ext.applyIf(options || {}, {protocol: this.protocol});
             action = new GeoExt.form.SearchAction(this, options);
         }
         return GeoExt.form.BasicForm.superclass.doAction.call(

Modified: core/tags/geoext/release-0.5/lib/GeoExt/widgets/form/SearchAction.js
===================================================================
--- core/tags/geoext/release-0.5/lib/GeoExt/widgets/form/SearchAction.js	2009-08-26 14:30:31 UTC (rev 1338)
+++ core/tags/geoext/release-0.5/lib/GeoExt/widgets/form/SearchAction.js	2009-08-27 07:00:12 UTC (rev 1339)
@@ -41,8 +41,7 @@
  *              url: "http://publicus.opengeo.org/geoserver/wfs",
  *              featureType: "tasmania_roads",
  *              featureNS: "http://www.openplans.org/topp"
- *          }),
- *          abortPrevious: true
+ *          })
  *      });
  *
  *      formPanel.getForm().doAction(searchAction, {
@@ -63,9 +62,6 @@
  *
  *      * form ``Ext.form.BasicForm`` A basic form instance.
  *      * options ``Object`` Options passed to the protocol'read method
- *            One can add an abortPrevious property to these options, if set
- *            to true, the abort method will be called on the protocol if
- *            there's a pending request.
  *
  *      When run this action builds an ``OpenLayers.Filter`` from the form
  *      and passes this filter to its protocol's read method. The form fields
@@ -114,19 +110,13 @@
         var o = this.options;
         var f = GeoExt.form.toFilter(this.form);
         if(o.clientValidation === false || this.form.isValid()){
-
-            if (o.abortPrevious && this.form.prevResponse) {
-                o.protocol.abort(this.form.prevResponse);
-            }
-
-            this.form.prevResponse = o.protocol.read(
+            this.response = o.protocol.read(
                 Ext.applyIf({
                     filter: f,
                     callback: this.handleResponse,
                     scope: this
                 }, o)
             );
-
         } else if(o.clientValidation !== false){
             // client validation failed
             this.failureType = Ext.form.Action.CLIENT_INVALID;
@@ -141,7 +131,6 @@
      *  Handle the response to the search query.
      */
     handleResponse: function(response) {
-        this.form.prevResponse = null;
         this.response = response;
         if(response.success()) {
             this.form.afterAction(this, true);

Modified: core/tags/geoext/release-0.5/tests/lib/GeoExt/widgets/form/SearchAction.html
===================================================================
--- core/tags/geoext/release-0.5/tests/lib/GeoExt/widgets/form/SearchAction.html	2009-08-26 14:30:31 UTC (rev 1338)
+++ core/tags/geoext/release-0.5/tests/lib/GeoExt/widgets/form/SearchAction.html	2009-08-27 07:00:12 UTC (rev 1339)
@@ -30,13 +30,13 @@
     }
 
     function test_run(t) {
-        t.plan(2);
+        t.plan(1);
 
         /*
          * Set up
          */
 
-        var field, form, action, protocol, log = {};
+        var field, form, action, protocol;
 
         var field = new Ext.form.TextField({
             name: "foo__eq",
@@ -63,42 +63,7 @@
         /*
          * Test
          */
-        action.run();
-
-        /**
-         * Set up for abortion test
-         */
-        log.abort = 0;
-        
-        protocol = {
-            read: function(options) {
-                return "something";
-            },
-            abort: function(response) {
-                log.abort++;
-            }
-        };
-        
-        action = new GeoExt.form.SearchAction(form.getForm(), {
-            protocol: protocol,
-            abortPrevious: true,
-            clientValidation: false
-        });
-
-        /*
-         * Test
-         */
-        action.run();
-
-        action.run();
-
-        t.wait_result(0.2);
-
-        action.options.abortPrevious = false;
-        action.run();
-        
-        t.wait_result(0.2);
-        t.ok(log.abort == 1, "protocol abort is correctly called and only once");
+       action.run();
     }
     </script>
   <body>



More information about the Commits mailing list