capture async widgets after they are loaded
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 4 May 2009 16:28:50 +0000 (16:28 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 4 May 2009 16:28:50 +0000 (16:28 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@13051 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/ui/default/acq/common/li_table.js

index 27a302d..aeecd18 100644 (file)
@@ -518,8 +518,11 @@ function AcqLiTable() {
                         orgLimitPerms : ['CREATE_PICKLIST'],
                         dijitArgs : {required:false}
                     });
-                    widget.build();
-                    self.copyBatchWidgets[field] = widget.widget;
+                    widget.build(
+                        function(w, ww) {
+                            self.copyBatchWidgets[field] = w;
+                        }
+                    );
                 }
             }
         );
@@ -584,7 +587,10 @@ function AcqLiTable() {
                 });
                 widget.build(
                     // make sure we capture the value from any async widgets
-                    function(w, ww) { copy[field](ww.getFormattedValue()) }
+                    function(w, ww) { 
+                        copy[field](ww.getFormattedValue()) 
+                        self.copyWidgetCache[copy.id()][field] = w;
+                    }
                 );
                 dojo.connect(widget.widget, 'onChange', 
                     function(val) { 
@@ -595,7 +601,6 @@ function AcqLiTable() {
                         }
                     }
                 );
-                self.copyWidgetCache[copy.id()][field] = widget.widget;
             }
         );