|
Mailing Lists
|
Home / Groups / Adobe Flex
Clear a RadioButtonGroup with binding?Hey y'all, here's my latest puzzler: I have a form with a radiobuttongroup. I have a field in a bean that the selectedValue is bound to. When the bean gets updated, and the value in the bean.field matches one of the radiobutton values, it sets it properly. When bean.field is NULL, it leaves the last-selected value in the radiobuttongroup. So... <code> [Bindable] myFormBean:FormBean; //this is set from the container, where it's //bound and included as an attribute of a custom comp. <mx:RadioButtonGroup id="myButtons" selectedValue="{myFormBean.colorPref}"/> <mx:RadioButton id="r" value="RED" label="Red"/> <mx:RadioButton id="b" value="BLUE" label="Blue"/> </code> When the bean is updated (as the result of a RemoteObject call), it selects one of the two radiobuttons. What it DOESN'T do is clear the group if colorPref == null. I know I can create a reset function... explicitly call .selection=null on all my radio buttons when I am about to get new data, but I really want there to be a cool binding-way to do this. Willy |
February 12, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||