plug baseWidgetValue setting for readOnly widgets back in with try/catch and comment...
authorerickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 4 Sep 2009 19:58:21 +0000 (19:58 +0000)
committererickson <erickson@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Fri, 4 Sep 2009 19:58:21 +0000 (19:58 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@13966 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/web/js/dojo/openils/widget/AutoFieldWidget.js
Open-ILS/web/js/ui/default/acq/common/li_table.js

index 10f6a99..2d40f71 100644 (file)
@@ -338,7 +338,21 @@ if(!dojo._hasResource['openils.widget.AutoFieldWidget']) {
          * For widgets that run asynchronously, provide a callback for finishing up
          */
         _widgetLoaded : function(value) {
-            if(!this.readOnly) {
+            
+            if(this.readOnly) {
+
+                /* -------------------------------------------------------------
+                   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); 
index d77af12..cacd808 100644 (file)
@@ -198,7 +198,7 @@ function AcqLiTable() {
 
         var recv_link = dojo.query('[name=receive_link]', row)[0];
 
-        if(li.state == 'on-order') {
+        if(li.state() == 'on-order') {
             recv_link.onclick = function() {
                 self.receiveLi(li);
                 openils.Util.hide(recv_link)