setting menulists (should work with editable=true also)
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 26 Jul 2005 15:06:29 +0000 (15:06 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 26 Jul 2005 15:06:29 +0000 (15:06 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1476 dcc99617-32d9-48b4-a31d-7c20da2025e4

Evergreen/staff_client/chrome/content/evergreen/util/widgets.js

index deacaf8..0284240 100644 (file)
@@ -422,6 +422,14 @@ function set_widget_value_for_display(e,v) {
                case 'textbox' : e.value = v; break;
                case 'label' : e.setAttribute('value',v); break;
                case 'image' : e.setAttribute('src',v); break;
+               case 'menulist' : e.value = v;
+                       var menupopup = menulist.firstChild;
+                       var menuitem;
+                       for (var i = 0; i < menupopup.childNodes.length; i++) {
+                               if (menupopup.childNodes[i].getAttribute('value') == v ) menuitem = menupopup.childNodes[i];
+                       }
+                       if (menuitem) e.selectedItem = menuitem;
+                       break;
                default: try {e.setAttribute('value',v); e.value = v;} catch(E) {} break;
        }
 }