From: senator Date: Thu, 9 Sep 2010 21:28:20 +0000 (+0000) Subject: Improve on 17547 to support a default value for /creating/ new objects while X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=816188ebd9e7e87f8d88eaf31bcfa087679259cd;p=contrib%2FConifer.git Improve on 17547 to support a default value for /creating/ new objects while 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 --- diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js b/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js index 013a2ed549..d94fd41655 100644 --- a/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js +++ b/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js @@ -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(); diff --git a/Open-ILS/web/js/dojo/openils/widget/EditPane.js b/Open-ILS/web/js/dojo/openils/widget/EditPane.js index 5d1f71f6d7..4e98b04fa5 100644 --- a/Open-ILS/web/js/dojo/openils/widget/EditPane.js +++ b/Open-ILS/web/js/dojo/openils/widget/EditPane.js @@ -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 + ); } }