calling widget.attr on readonly objects occaisonally results in errors from (as yet...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 1 Sep 2009 14:19:21 +0000 (14:19 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 1 Sep 2009 14:19:21 +0000 (14:19 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_6@13939 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 23192cf..10f6a99 100644 (file)
@@ -115,7 +115,7 @@ if(!dojo._hasResource['openils.widget.AutoFieldWidget']) {
             }
             
             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)
@@ -338,9 +338,7 @@ if(!dojo._hasResource['openils.widget.AutoFieldWidget']) {
          * For widgets that run asynchronously, provide a callback for finishing up
          */
         _widgetLoaded : function(value) {
-            if(this.readOnly) {
-                this.baseWidgetValue(this.getDisplayString());
-            } else {
+            if(!this.readOnly) {
                 this.baseWidgetValue(this.widgetValue);
                 if(this.idlField.name == this.fmIDL.pkey && this.fmIDL.pkey_sequence)
                     this.widget.attr('disabled', true);