Improve on 17547 to support a default value for /creating/ new objects while
authorsenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 9 Sep 2010 21:28:20 +0000 (21:28 +0000)
committersenator <senator@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 9 Sep 2010 21:28:20 +0000 (21:28 +0000)
letting the current value of an object pass through to the overriding widget
when /editing/.

git-svn-id: svn://svn.open-ils.org/ILS/trunk@17555 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
Open-ILS/web/js/dojo/openils/widget/EditPane.js

index 013a2ed..d94fd41 100644 (file)
@@ -177,7 +177,10 @@ if(!dojo._hasResource['openils.widget.AutoFieldWidget']) {
                 if(this.parentNode) // may already be in the "right" place
                     this.parentNode.appendChild(this.widget.domNode);
                 if (this.shove) {
-                    this.widget.attr("value", this.widgetValue);
+                    if (this.shove.mode == "update")
+                        this.widget.attr("value", this.widgetValue);
+                    else
+                        this.widgetValue = this.shove.create;
                     this._widgetLoaded();
                 } else if (this.widget.attr("value") == null) {
                     this._widgetLoaded();
index 5d1f71f..4e98b04 100644 (file)
@@ -126,9 +126,11 @@ if(!dojo._hasResource['openils.widget.EditPane']) {
                     );
 
                     if (this.overrideWidgets[field.name]) {
-                        if (this.overrideWidgets[field.name].shove &&
-                            this.mode == "update") {
-                            args.shove = true;
+                        if (this.overrideWidgets[field.name].shove) {
+                            args.shove = dojo.mixin(
+                                {"mode": this.mode},
+                                this.overrideWidgets[field.name].shove
+                            );
                         }
                     }