For lists (AW.UI.List, AW.UI.CheckedList, AW.UI.Radio) you have to specify what is 'control value' and also make sure the hidden input tag is updated -
List: // set control value when list item is selected
obj.onSelectedItemsChanged = function(items){
this.setControlValue(items.join(","));
}
// update hidden input tag - 'data' element
obj.onControlValueChanged = function(){
this.getContent("data").refresh();
}
Radio: // set control value when list item is selected
radio.onSelectedItemsChanged = function(items){
var index = items[0]; // assume there is one selected item
var value = this.getItemValue(index);
this.setControlValue(value);
}
// update hidden input tag - 'data' element
radio.onControlValueChanged = function(){
this.getContent("data").refresh();
}
Alex (ActiveWidgets)
Friday, July 18, 2008
Thanks so far.
I presume that I must create a hidden input field to return the values? This is not totally clear in the documentation. Normally, the return values are a property of the control object itself.
Is "data" referring to some external hidden input such as a hidden text field OR is it a property of the content within the radio.Control.Value?
Myshka
Friday, July 18, 2008
>> I must create a hidden input field to return the values
No, each control already creates hidden 'data' element as soon as you call setName() method, and it is updated with getContent("data").refresh().