From 2b338c6b8e69dfddb3faa41945acfdf5dfc36379 Mon Sep 17 00:00:00 2001
From: senator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Date: Thu, 9 Sep 2010 18:53:14 +0000
Subject: [PATCH] Make overrideEditWidgets to an AutoGrid able to accept shoved
 in values from the fields of the object they're editing.

git-svn-id: svn://svn.open-ils.org/ILS/trunk@17547 dcc99617-32d9-48b4-a31d-7c20da2025e4
---
 Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js | 6 +++++-
 Open-ILS/web/js/dojo/openils/widget/EditPane.js        | 7 +++++++
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js b/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
index 8c3a3cf80f..013a2ed549 100644
--- a/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
+++ b/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
@@ -176,8 +176,12 @@ if(!dojo._hasResource['openils.widget.AutoFieldWidget']) {
                 // core widget provided for us, attach and move on
                 if(this.parentNode) // may already be in the "right" place
                     this.parentNode.appendChild(this.widget.domNode);
-                if(this.widget.attr('value') == null)
+                if (this.shove) {
+                    this.widget.attr("value", this.widgetValue);
                     this._widgetLoaded();
+                } else if (this.widget.attr("value") == null) {
+                    this._widgetLoaded();
+                }
                 return;
             }
             
diff --git a/Open-ILS/web/js/dojo/openils/widget/EditPane.js b/Open-ILS/web/js/dojo/openils/widget/EditPane.js
index 800eb0b339..5d1f71f6d7 100644
--- a/Open-ILS/web/js/dojo/openils/widget/EditPane.js
+++ b/Open-ILS/web/js/dojo/openils/widget/EditPane.js
@@ -125,6 +125,13 @@ if(!dojo._hasResource['openils.widget.EditPane']) {
                         this.overrideWidgetArgs[field.name] // per-field overrides
                     );
 
+                    if (this.overrideWidgets[field.name]) {
+                        if (this.overrideWidgets[field.name].shove &&
+                            this.mode == "update") {
+                            args.shove = true;
+                        }
+                    }
+
                     if(args.readOnly) {
                         dojo.addClass(nameTd, 'openils-widget-editpane-ro-name-cell');
                         dojo.addClass(valTd, 'openils-widget-editpane-ro-value-cell');
-- 
2.11.0