House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home / Groups / Adobe Flex

Clear a RadioButtonGroup with binding?

Author:
Willy Ray
12/03/2009 04:53 PM

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


Search flex

February 12, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29