[open-ils-commits] r16443 - trunk/Open-ILS/web/js/ui/default/acq/common (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon May 17 15:57:08 EDT 2010


Author: erickson
Date: 2010-05-17 15:57:03 -0400 (Mon, 17 May 2010)
New Revision: 16443

Modified:
   trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js
Log:
better handling of mingling readOnly and non-readOnly widgets during copy update in lineitem table

Modified: trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js	2010-05-17 17:08:26 UTC (rev 16442)
+++ trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js	2010-05-17 19:57:03 UTC (rev 16443)
@@ -1437,25 +1437,31 @@
                     orgLimitPerms : ['CREATE_PICKLIST', 'CREATE_PURCHASE_ORDER'],
                     readOnly : readOnly,
                 });
+
                 widget.build(
                     // make sure we capture the value from any async widgets
                     function(w, ww) { 
+
                         if (field == "fund" && w.store)
                             self._ensureCSSFundClasses(w.store);
-                        copy[field](ww.getFormattedValue()) 
+
+                        if(!readOnly) 
+                            copy[field](ww.getFormattedValue()) 
+
                         self.copyWidgetCache[copy.id()][field] = w;
-                    }
-                );
-                dojo.connect(widget.widget, 'onChange', 
-                    function(val) { 
-                        if (field == "fund")
-                            self._updateFundSelectorStyle(widget, val);
 
-                        if (copy.isnew() || val != copy[field]()) {
-                            // prevent setting ischanged() automatically on widget load for existing copies
-                            copy[field](widget.getFormattedValue()) 
-                            copy.ischanged(true);
-                        }
+                        dojo.connect(w, 'onChange', 
+                            function(val) { 
+                                if (field == "fund")
+                                    self._updateFundSelectorStyle(widget, val);
+
+                                if (!readOnly && (copy.isnew() || val != copy[field]())) {
+                                    // prevent setting ischanged() automatically on widget load for existing copies
+                                    copy[field](widget.getFormattedValue()) 
+                                    copy.ischanged(true);
+                                }
+                            }
+                        );
                     }
                 );
             }



More information about the open-ils-commits mailing list