Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 8317bd6

Browse files
committed
Fix FormManager : dynamic selectors do not select default value correctly when list returns groups.
(cherry picked from commit 68d521e)
1 parent c86f299 commit 8317bd6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

core/src/plugins/gui.ajax/res/js/ui/prototype/class.FormManager.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,15 +428,21 @@ Class.create("FormManager", {
428428
var opt = new Element("OPTGROUP", {label:key});
429429
element.insert(opt);
430430
for (var index=0;index<json.LIST[key].length;index++){
431-
element.insert(new Element("OPTION").update(json.LIST[key][index].action));
431+
var option = new Element("OPTION").update(json.LIST[key][index].action);
432+
if(json.LIST[key][index].action == defaultValue) {
433+
option.setAttribute("selected", "true");
434+
}
435+
element.insert(option);
432436
}
433437
}
434438
}
435439
}else{
436440
for (key in json.LIST){
437441
if(json.LIST.hasOwnProperty(key)){
438442
var option = new Element("OPTION", {value:key}).update(json.LIST[key]);
439-
if(key == defaultValue) option.setAttribute("selected", "true");
443+
if(key == defaultValue) {
444+
option.setAttribute("selected", "true");
445+
}
440446
element.insert(option);
441447
}
442448
}

0 commit comments

Comments
 (0)