Keep backward compatibility for setSelectedValue() javascript function on autocompleter tag

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@543909 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Musachy Barroso
2007-06-03 14:49:50 +00:00
parent 89008980f0
commit 60b224e647
@@ -494,13 +494,17 @@ dojo.widget.defineWidget(
},
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;
}
},