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

RadioButton and RBGroup - make CHANGE event work like List's with oldIndex and newIndex for RBGroup and add CHANGING event to RB and RBGroup

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • Adobe Flex SDK Previous
    • None
    • Spark: RadioButton
    • None
    • Affected OS(s): Windows
      Affected OS(s): Windows 7
      Browser: Firefox 3.x
      Language Found: English

    Description

      Copied from the adobe flex forum: http://forums.adobe.com/message/4024062#4024062

      RadioButton - add CHANGING event
      RadioButtonGroup - remake FlexEvent.CHANGE -> IndexChangeEvent.Change like List's with newIndex, oldIndex. Add CHANGING event.

      Below I explain my thoughts and arguments why that should be. Please read further.

      Here is a simple scenario:

      User must select between 2 radio buttons:

      1) no volume -> sets variable volume=0 and selects the radio button (that is the normal use case)
      2) set volume -> opens up a pop up with a list that has a X button to close and 4 options: 25% volume, 50% volume, 75%, 100%

      At this point the set volume radio button should not be selected and the user has 2 choices:

      -> hit the X button to close - nothing changes and no volume radio button is still selected and volume is still = 0

      -> hit one of the volume % buttons -> the set volume radio button gets selected and the variable volume=25/50/75/100 depending on the button selected by the user.

      That's a pretty common scenario and it's bugging me that I can't easily alter the radio button selection logic since whenever I click it, it gets selected and I can't put a logic in between in a standard way. This should apply to any component with selection, just like ButtonBar has it with the Changing event.
      It is designed like this cause there is not much space to put all the radio buttons and the data they carry - the example I gave with the volume is just to explain the logic. The real example is more complicated not like volume, that's why they group the functionality like that.

      What I did right now is: clicking the radio button deselects it and then selects it or not depending on the outcome. But as a user interaction and feedback the radio button should not go selected and deselected back and forth unless it stays that way and since the selected process has not been finished it should not be marked as selected upfront. Not to mention that the selection flickers since you move the selection and then revert it.
      Also sometimes successful selection of a radio button would immediately activate showing next screen for example and in this case I would have to write more complicated logic for some radio buttons to not show the next screen on selection and move that logic in the pop up they open.

      Since there are 2 ways to use groups with radio buttons: group and groupName properties. groupName is ok, but group is not acting as expected either - There is Change event for the RadioButtonGroup but it's not an IndexChangeEvent like the List or the ButtonBar -> I was expecting the same logic with Change and Changing events and newIndex and oldIndex stuff. I'm surprised it's not the same since in a way it's a simplier version of them and I think it would be better if you could mimic that if it's possible - this would standardize the way groups/lists work which is always good. Currently I ended up using ItemClickEvent.ITEM_CLICK instead of FlexEvent.CHANGE which at least gives me the new item selected.

      Well I hope I was convincing enough.

      Best Regards,
      Filip Nedyalkov

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated: