Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-24451

spark radiobuttongroup does not support setting the selectedValue to null

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Cannot Reproduce
    • Adobe Flex SDK 4.1 (Release)
    • None
    • Spark: RadioButton
    • None
    • Affected OS(s): Windows
      Affected OS(s): Windows XP
      Language Found: English

    Description

      Example below: select a radio button, click the Clear button, echo the selected radio button - still the value of the selected radio button.

      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:mx="library://ns.adobe.com/flex/mx"
      minWidth="955" minHeight="600">
      <fx:Script>
      <![CDATA[
      import mx.controls.Alert;
      ]]
      >
      </fx:Script>

      <fx:Declarations>
      <s:RadioButtonGroup id="myGroup" />
      </fx:Declarations>

      <s:layout>
      <s:VerticalLayout />
      </s:layout>

      <s:RadioButton value="value1" label="Value 1" group="

      {myGroup}" />
      <s:RadioButton value="value2" label="Value 2" group="{myGroup}

      " />
      <s:Button label="clear radio" click="myGroup.selectedValue = null;" />
      <s:Button label="echo selected radio" click="Alert.show(myGroup.selectedValue as String);" />
      </s:Application>

      Clearing the selectedValue should both clear the selected value and uncheck all radio buttons.

      Workaround is tough but possible because vars are private in radiobuttongroup (_selection).

      This is a regression because mx radiobuttongroup allowed this.

      Attachments

        Activity

          People

            Unassigned Unassigned
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: