Author: musachy
Date: Sun Jun  3 07:49:50 2007
New Revision: 543909

URL: http://svn.apache.org/viewvc?view=rev&rev=543909
Log:
Keep backward compatibility for setSelectedValue() javascript function on 
autocompleter tag

Modified:
    
struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/ComboBox.js

Modified: 
struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/ComboBox.js
URL: 
http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/ComboBox.js?view=diff&rev=543909&r1=543908&r2=543909
==============================================================================
--- 
struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/ComboBox.js
 (original)
+++ 
struts/struts2/trunk/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/struts/widget/ComboBox.js
 Sun Jun  3 07:49:50 2007
@@ -494,13 +494,17 @@
   },
   
   setSelectedValue : function(text) {
-    var data = this.dataProvider.data;
-    for(element in data) {
-       var obj = data[element];
-       if(obj[0].toString() == text) {
-         this.setValue(obj[0].toString());
-         this.comboBoxSelectionValue.value = obj[1].toString();
-       }
+    if(this.dataProvider) {
+      var data = this.dataProvider.data;
+      for(element in data) {
+         var obj = data[element];
+         if(obj[0].toString() == text) {
+           this.setValue(obj[0].toString());
+           this.comboBoxSelectionValue.value = obj[1].toString();
+         }
+      }
+    } else {
+      this.comboBoxSelectionValue.value = text;
     }
   },
   


Reply via email to