3.2.0

Radio control not returning initial value

loading this control and displaying the presently set value. if the user does a POST back to the server, an empty value is returned. if the user clicks on the value, it will appear. i'm missing something in setting the initial data state.

var d002001 = new AW.UI.Radio;
d002001.setId("d002001");
d002001.setName("d002001");
d002001.setItemValue(["Medical","Vision","Retail"]);
d002001.setItemText(["Medical","Vision","Retail"]);
d002001.setItemCount(3);
d002001.setSelectedItems([1]);
d002001.onSelectedItemsChanged = function(items){
var index = items[0]; // assume there is one selected item
var value = this.getItemValue(index);
this.setControlValue(value);
}
d002001.onControlValueChanged = function(){
this.getContent("data").refresh();
}
d002001.setClass("flow","horizontal");
d002001.refresh();
Myshka
August 1,
I guess it should work if you move setSelectedItems() call after assigning onSelectedItemsChanged and onControlValueChanged event handlers.
Alex (ActiveWidgets)
August 4,

This topic is archived.

See also:


Back to support forum