Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 300363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T06:54:26+00:00 2026-05-12T06:54:26+00:00

I have a UI component that, for various reasons, I have to construct programatically.

  • 0

I have a UI component that, for various reasons, I have to construct programatically. The component is a table of radio buttons grouped by column.

Right now, I’m constructing the column groups like so:

private function createGroupsForItemList(items: XMLList): void {
    for each (var item: XML in items) {
        var rbGroup: RadioButtonGroup = new RadioButtonGroup();
        groups[item.@level.toString()] = rbGroup;
    }
}

I’m trying to associate the RadioButton instances with the column groups like so:

private function createValueControl(item: XML): UIComponent {
    var control: RadioButton = new RadioButton();
    control.label = "";
    control.group = groups[item.@level.toString()];
    control.addEventListener(Event.SELECT, updateSelection);
    return control;
}

I can see in the debugger that the control has an association to the group:

control.group == groups[item.@level.toString()]

However, I can see equally that the group does not know anything about the control:

group.radioButtons.length == 0

I imagine that this is because the setter for group in RadioButton is a dumb setter; all it does is copy to the variable, which doesn’t do the magic that groupName does. However, I can’t seem to find the value I should use to set the RadioButton.groupName property correctly.

So, in short, I’m stumped on how to get these bits to talk to each other. How do I do this?

— EDIT —

It turns out that I can have the groups created and associated simply by setting the groupName property, but I can’t get at the group to set up a selection listener; the group is NULL immediately after the setting process, which means that the second line below throws the Flex equivalent of an NPE:

control.groupName = groupNameForLevel(item);
control.group.addEventListener(Event.SELECT, updateSelection);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T06:54:26+00:00Added an answer on May 12, 2026 at 6:54 am

    First instinct is that this issue has to do with invalidateDisplayList and when and how that is called. Of course, since issues related to that function are behind a number of Flex’s quirks, I may just be scapegoating.

    This is not the answer to your question per se, but it seems like it might actually work as an alternate solution.

    RadioButtonGroups will initialize based on a IFlexDisplayObject. This means that you can do something like:

    var c:HBox               = new HBox();
    var rbg:RadioButtonGroup = new RadioButtonGroup( c );
    // do stuff with rbg.
    c.addChild( new RadioButton() );
    

    The problem is that it may not be the most practical answer, but it has the decided benefit of being a workable solution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 207k
  • Answers 207k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I think you can do something like: $("#NumberId option[value='']").val('0'); good… May 12, 2026 at 9:18 pm
  • Editorial Team
    Editorial Team added an answer This is a great chance to introduce you to the… May 12, 2026 at 9:18 pm
  • Editorial Team
    Editorial Team added an answer string SubString = MyString.Substring(MyString.Length-6); May 12, 2026 at 9:18 pm

Related Questions

my background: i've been developing web applications using php and javascript for the past
We have a system whose behavior is defined by a number of XML files.(Roughly
Keeping classes loosely coupled is an important aspect of writing code that is easy
I have a Java Swing UI that isn't updating/repainting as I thought it should.

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.