[open-ils-commits] r16198 - branches/rel_1_6_0/Open-ILS/web/js/dojo/openils/widget (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon Apr 12 08:52:35 EDT 2010


Author: erickson
Date: 2010-04-12 08:52:34 -0400 (Mon, 12 Apr 2010)
New Revision: 16198

Modified:
   branches/rel_1_6_0/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
Log:
backport 13966: protecting against dissapearing grid cells during grid render of autowidget

Modified: branches/rel_1_6_0/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
===================================================================
--- branches/rel_1_6_0/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js	2010-04-09 20:27:50 UTC (rev 16197)
+++ branches/rel_1_6_0/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js	2010-04-12 12:52:34 UTC (rev 16198)
@@ -117,7 +117,7 @@
             }
             
             if(!this.parentNode) // give it somewhere to live so that dojo won't complain
-                this.parentNode = document.createElement('div');
+                this.parentNode = dojo.create('div');
 
             this.onload = onload;
             if(this.widgetValue == null)
@@ -331,9 +331,21 @@
          * For widgets that run asynchronously, provide a callback for finishing up
          */
         _widgetLoaded : function(value) {
+            
             if(this.readOnly) {
-                this.baseWidgetValue(this.getDisplayString());
+
+                /* -------------------------------------------------------------
+                   when using widgets in a grid, the cell may dissapear, which 
+                   kills the underlying DOM node, which causes this to fail.
+                   For now, back out gracefully and let grid getters use
+                   getDisplayString() instead
+                  -------------------------------------------------------------*/
+                try { 
+                    this.baseWidgetValue(this.getDisplayString());
+                } catch (E) {};
+
             } else {
+
                 this.baseWidgetValue(this.widgetValue);
                 if(this.idlField.name == this.fmIDL.pkey && this.fmIDL.pkey_sequence)
                     this.widget.attr('disabled', true); 



More information about the open-ils-commits mailing list