From 8ff31e2c6cecc511cfb192cf4a7942c94ec5b8ad Mon Sep 17 00:00:00 2001
From: erickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Tue, 2 Feb 2010 21:25:44 +0000
Subject: [PATCH] permacrud CUD actions support an oncomplete handler, but the
 request object passed as the argument already had it's responses pulled from
 the wire.  pass the return_list as a second param to CUD onhandler functions.
  updated auto widgets to match

git-svn-id: svn://svn.open-ils.org/ILS/trunk@15435 dcc99617-32d9-48b4-a31d-7c20da2025e4
---
 Open-ILS/web/js/dojo/openils/PermaCrud.js         | 2 +-
 Open-ILS/web/js/dojo/openils/widget/AutoGrid.js   | 4 ++--
 Open-ILS/web/js/dojo/openils/widget/EditDialog.js | 4 ++--
 Open-ILS/web/js/dojo/openils/widget/EditPane.js   | 4 ++--
 4 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/Open-ILS/web/js/dojo/openils/PermaCrud.js b/Open-ILS/web/js/dojo/openils/PermaCrud.js
index 1dfefe97ab..5dbc8137e9 100644
--- a/Open-ILS/web/js/dojo/openils/PermaCrud.js
+++ b/Open-ILS/web/js/dojo/openils/PermaCrud.js
@@ -237,7 +237,7 @@ if(!dojo._hasResource["openils.PermaCrud"]) {
                                     var res = r.recv();
                                     if ( res && res.content() ) {
                                         if(req._final_complete)
-                                            req._final_complete(req);
+                                            req._final_complete(req, _return_list);
                                         _pcrud.disconnect();
                                     } else {
                                         _pcrud.disconnect();
diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
index dd9f114f12..54fd667fb2 100644
--- a/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
+++ b/Open-ILS/web/js/dojo/openils/widget/AutoGrid.js
@@ -417,8 +417,8 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) {
                     overrideWidgetClass : this.overrideEditWidgetClass,
                     overrideWidgetArgs : this.overrideWidgetArgs,
                     disableWidgetTest : this.disableWidgetTest,
-                    onPostSubmit : function(r) {
-                        var fmObject = openils.Util.readResponse(r);
+                    onPostSubmit : function(req, cudResults) {
+                        var fmObject = cudResults[0];
                         if(grid.onPostCreate)
                             grid.onPostCreate(fmObject);
                         if(fmObject) 
diff --git a/Open-ILS/web/js/dojo/openils/widget/EditDialog.js b/Open-ILS/web/js/dojo/openils/widget/EditDialog.js
index 6bb66bdfed..08a22dece5 100644
--- a/Open-ILS/web/js/dojo/openils/widget/EditDialog.js
+++ b/Open-ILS/web/js/dojo/openils/widget/EditDialog.js
@@ -38,9 +38,9 @@ if(!dojo._hasResource['openils.widget.EditDialog']) {
                     self.hide(); 
                 }
 
-                this.editPane.onPostSubmit = function(r) { 
+                this.editPane.onPostSubmit = function(r, cudResults) { 
                     self.hide(); 
-                    if(onSubmit) onSubmit(r);
+                    if(onSubmit) onSubmit(r, cudResults);
                 }
             },
 
diff --git a/Open-ILS/web/js/dojo/openils/widget/EditPane.js b/Open-ILS/web/js/dojo/openils/widget/EditPane.js
index 051fa9994c..525a4cd0af 100644
--- a/Open-ILS/web/js/dojo/openils/widget/EditPane.js
+++ b/Open-ILS/web/js/dojo/openils/widget/EditPane.js
@@ -165,9 +165,9 @@ if(!dojo._hasResource['openils.widget.EditPane']) {
             performAutoEditAction : function() {
                 var self = this;
                 self.performEditAction({
-                    oncomplete:function(r) {
+                    oncomplete:function(req, cudResults) {
                         if(self.onPostSubmit)
-                            self.onPostSubmit(r);
+                            self.onPostSubmit(req, cudResults);
                     }
                 });
             },
-- 
2.11.0