Fix cloning of AutoField widgets: LP #728055
authordbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 7 Mar 2011 15:07:39 +0000 (15:07 +0000)
committerdbs <dbs@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 7 Mar 2011 15:07:39 +0000 (15:07 +0000)
Cloning Action/Trigger event definitions was not working properly, as
all values were being copied from the original object using their display
strings rather than the underlying values.

Bill Erickson suggested a fix in IRC that works, so full credit to him
for this change!

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

Open-ILS/web/js/dojo/openils/widget/AutoGrid.js

index 3e99b28..ecbdf95 100644 (file)
@@ -469,8 +469,8 @@ if(!dojo._hasResource['openils.widget.AutoGrid']) {
                         if(field.widget.widget.attr('disabled')) return;
                         var w = clonePane.fieldList.filter(
                             function(i) { return (i.name == field.name) })[0];
-                        w.widget.baseWidgetValue(field.widget.widgetValue); // sync widgets
-                        w.widget.onload = function(){w.widget.baseWidgetValue(field.widget.widgetValue)}; // async widgets
+                        w.widget.baseWidgetValue(field.widget.widget.attr('value')); // sync widgets
+                        w.widget.onload = function(){w.widget.baseWidgetValue(field.widget.widget.attr('value'))}; // async widgets
                     }
                 );
                 origPane.destroy();