From: erickson Date: Tue, 1 Sep 2009 14:19:21 +0000 (+0000) Subject: calling widget.attr on readonly objects occaisonally results in errors from (as yet... X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c0893101b31f330bc5e75bd083b9d5f33f5f2dc2;p=Evergreen.git calling widget.attr on readonly objects occaisonally results in errors from (as yet unexplained) dojo race condition. however, basewidgetvalue is not needed for readOnly widgets, since displaystring is used, so bypasss for now; use dojo.create git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_6@13939 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js b/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js index 23192cf4bc..10f6a99a58 100644 --- a/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js +++ b/Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js @@ -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);