From 816188ebd9e7e87f8d88eaf31bcfa087679259cd Mon Sep 17 00:00:00 2001 From: senator Date: Thu, 9 Sep 2010 21:28:20 +0000 Subject: [PATCH] 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 --- Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js | 5 ++++- Open-ILS/web/js/dojo/openils/widget/EditPane.js | 8 +++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js b/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js index 013a2ed54..d94fd4165 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 5d1f71f6d..4e98b04fa 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 + ); } } -- 2.11.0