Group and dynamics of radio button

Hi, we have created dynamic radio button and group on the whole "building applications" event , but who I am trying to get number of radio button his zero show, see code below


import flash.utils.setTimeout;
import mx.controls.Alert;
import mx.events.FlexEvent;
import spark.components.RadioButton;
import spark.components.RadioButtonGroup;

private var  rbg:RadioButtonGroup;
private var  rb1:RadioButton;
private var  rb2:RadioButton;
private var dcount:int = 0;
     
protected function application1_creationCompleteHandler(event:FlexEvent):void
{
     // TODO Auto-generated method stub
     // TODO Auto-generated method stub
     rb1 = new RadioButton();
     rb2 = new RadioButton();
     rbg = new RadioButtonGroup();
     
     
     rb1.label = "Radio1";
     rb2.label = "Radio2";
     
     rb1.group = rbg;
     rb2.group = rbg;
     
     
     vbox1.addChild(rb1);
     vbox1.addChild(rb2);
     
     checkRadioButton ();  
          
}

protected function checkRadioButton ():void
{
     Alert.show("In checkRadioButton function : " +  rb1.group.numRadioButtons.toString()); 
}

If I set a time interval to call the checkRadioButton function its works very well.

//checkRadioButton ();  
setTimeout(checkRadioButton,1000);

but this is not recommended.
Why this happens... can someone delete this or any other way to do it.


Thanks in advance

@manjeet.patel,.

Just write the code line

vbox1.validateNow ();

You should not use setTimeout() function

-----------------------------------------------------------------

vbox1. AddChild (RB1);
vbox1. AddChild (RB2);

vbox1.validateNow ();

Thank you

Jean Claude

Tags: Flex

Similar Questions

  • Using switch and case with Radio buttons

    Can I use the case switch with radio buttons?

    What will be the parameter to determine the choice like xfa.event.newText is used for the drop-down list.

    Aditya

    Hi Aditya,

    Select the exclusion group in the hierarchy (you have no script each option button) and select the click event. The switch statement would use the this.rawValue.

    Hope that helps,

    Niall

  • Same radio buttons (groups) on two pages

    Two PDF pages with forms: for the most part the same - first of all the page for company, second for the customer. Contains the same forms (differences above, marked as copy for the customer or for society + some additional images on companys copy).

    In Acrobat Pro MS I did and copied shapes from the first page to the second, so they have the same names, and after completing their on the first page, same forms are automatically filled on second too (as expected).

    OK to the check boxes and text fields. Problem with just the radio - changes buttons are not copied to the second page. And when the radio button is checked on the second page, radio buttons in the same group on the first page will be disabled.

    For now, I removed radio buttons copied on the second page (3 groups with 2 to 4 radio buttons) and created new ones (with new names). They can by completed independently (variations on a single page will not register/unregister radios on another page). Better, but not perfect.

    Is it possible to make radio-buttons work even in the text and checkboxes? Thus, when filling on the first page, the changes are automatically copied to the second page (and when someone make changes on the second page, they are copied to the first page too).

    Thanks for the advice (and patience with my English).

    Go to the properties of one of these boxes and option under the tab tick box Options "buttons with the same name and the choices are selected in unison.

  • Hidden, Visible and back to hidden with the help of a radio button

    OK, this could be really simple for a person to answer.

    I have an option button that I use to switch between two list boxes with multiple lines of text (so visible and hidden). Here's the problem, when I switch the radio back and forward button, I have two list boxes displaying their notes at the same time. I would like to have the option button display a messages both when you switch between them. Here is my script.

    Radio Button named Violation:

    Form1. #pageSet [0]. Page 1. .Act of #subform [0] [1]. Violation::click - (JavaScript, client)

    If (this.rawValue == null) {}

    Notes.Presence = 'hidden ';

    }

    else {}

    Notes.Presence = "visible";

    }

    Radio Button named Suspension:

    Form1. #pageSet [0]. Page 1. .Act of #subform [0] [1]. Suspension::click - (JavaScript, client)

    If (this.rawValue == null) {}

    Notes2.presence = 'hidden ';

    }

    else {}

    Notes2.presence = "visible";

    }

    Notes and billets2 are list boxes. Violation and Suspension are radio buttons. Is this correct? If so, are Violation and Suspension in a group of exclusion?

    This is the requirement, breach should view Notes and hide billets2 and Suspension must hide the Notes and display billets2?

    Steve

  • Radio buttons in different objects is part of the same group?

    Hi all

    I have a component custom with a radio button and enter text in there. I'm dynamically adding instances of these components in a VGroup, however, I have difficulties to do belong to the same group of radio button.  I tried to adjust their property groupName under the same name, but they always behave as separate radio buttons (you can select all of them and they will be selected).  Does anyone have any ideas on how I can do belong to the same radio button group? Any help will be greatly appreciated. Thank you.

    Create a RadioButtonGroup in the main application, and set the Group on the

    Radio buttons in the group.

  • Is it possible to disable the radio button group?

    Hello.

    I want to know is - it possible to temporarily disable the radio button group? Because IM planning group temporarily disable the radio button in my project so that the timer to pause. Can someone help me?

    No you have to use the names of buttons, for example:

    Btn1. Enabled = btn2.enabled = btn3.enabled = false;

  • Radio button to automatically populate a Textfield?

    Hello

    Im trying to create a pdf file in the case where:

    -1 radio button"(Group A) is then selected"TEXTFIELD 1 "auto fills with"BLA BLA BLA"

    -2 radio button"(Group A) is then selected"TEXTFIELD 1 "auto fills with"DOH DOH DOH"

    How can I do this? I have no idea? IM pretty new to pdf forms

    Thank you in anticipation

    Ginga

    Like all shows, there might be multiple solutions, and very specific data are needed.

    A possible calculation of custom JavaScript for 'TEXTFIELD 1' might be:

    If (this.getField("group_A").value == 'Off') event.value = "";

    If (this.getField("group_A").value == 'Yes') event.value = "BLA BLA BLA";

    If (this.getField("group_A").value == 'No') event.value = "DOH DOH DOH".

    You should maybe change the field names and values for radio buttons to match you specific situation.

  • Visible field according to a choice of radio button

    Hi all

    I have this form where I have a group of yes/no radio buttons. I would like to a numeric field to appear only when users click Yes. When the form opens, or if users do not set it to Yes (not default) field should not appear.

    There is a min and max limit attached to this field, which should only kick in when the field (limits of should not be applied when the field is hidden).

    My questions are:

    Where should I put the condition visible/hidden? In the Group of radio button or on each subform condition yes/no? I tried both, so far, but it did not work.

    The script I've tried is (at the exit event of the Group of radio buttons):

    If (this.rawValue == 2) {}

    ... RightDetection.ChoixYesNo.DetectionDelay.presence = "visible".

    }

    else (this.rawValue == 1) {}

    ... RightDetection.ChoixYesNo.DetectionDelay.presence = "hidden".

    }

    The limit min/max used to work before, but since I started playing with this area, I now have an error on the first bracket. Could someone tell me why?

    The limit script is as follows:

    If (this.rawValue < 1)

    {

    xfa.host.messageBox ("specify at least 1 in this area", "Warning", 1, 0);

    xfa.host.setFocus (this);

    }

    If (this.rawValue > 365)

    {

    xfa.host.messageBox ("specify in most of the 365 in this area", "Warning", 1, 0);

    xfa.host.setFocus (this);

    }

    Thank you very much in advance for your help.

    Why not not just the value of the type field user entered - required

  • Dynamic radio button fields do not display again after registered form

    Hello

    I have a group of questions of radio button at the breast of a dynamic form that display additional questions based on the answer.

    So to the question "is there a basement?" If the user indicates Yes, there is a basement, additional questions are displayed in order to collect more information on the basement. If the user says no, while these questions do not appear.

    Everything works beautifully in the form. However, when the form is saved and then re-opened, other issues do not appear in the form. So, the structure goes to this:

    image1.jpg

    To do this:

    image2.jpg

    Users must toggle buttons radio to reappear these issues... and when they reappear, they maintained that respond to the user indicated before the Save.

    I don't know why this happens... does anyone have advice?

    Thank you

    Theresa

    Can you make sure you have state changes based on an automatic script enabled for your form. If you go to file-> properties of form-> by default and see what the script option button is selected. If you have manually, you need to handle all state change yourself and you are not as likely at the present time. Try him affecting automatically and see if it works on the opening of the saved pdf file. I did a quick in Designer 8.2 and it seemed to match your question.

  • 2 sets of radio buttons in a form-complications

    Hi all

    I've been looking around for code to assist me in building a form. I have developed the form and just a few problems that I can't understand.

    In a question on the form, the user can select from a set of radio buttons and select one of the five options. Then I have a second set of option buttons that the user can choose only one option. My problem is that I don't want the user to be able to select from the second set of option buttons if they chose a certain option in the first set. An example to clarify my problem:

    You have completed the training:

    Yes

    Half

    None

    So if the user selected Yes in the first set of option buttons, I want the second set of option buttons to now be selectable:

    The training was:

    Up-beat and nice

    Snoozer

    I use are very different than the latter, but it's just a simple sketch. So, how can I do the second set of radio buttons not selectable until the user selects a specific option button in the first set of option buttons.

    Thanks, I really appreciate the help!

    If you have an exclusion group called "completion" with three elements 'Yes' radio button 'Half' and 'None' and a second radio button exclusion group called "completion", go to the value of 'feedback' tab and set the type to "readOnly".

    Add the following script to the "end"... change event

    Form1.Page1.Subform1.completion::change - (JavaScript, client)

    If (this.rawValue == 'Yes') {}

    Form1.Page1.Subform1.feedback.access = "";

    }

    else {}

    Form1.Page1.Subform1.feedback.access = "readOnly";

    Form1.Page1.Subform1.feedback.RawValue = "";

    }

    If the user selects "Yes", the "feedback" group is available for selection. If the user does not select 'Yes', 'feedback' is reset and readOnly.

    Steve

  • Required radio buttons - Possible Cause of unable to submit the form?

    I'm missing something about radio buttons.  Create a form of 9 page using the layout fluid and with the previous help from this forum, am being tested now.  It's a long questionnaire and questions are radio buttons, some are checkboxes.  For radio buttons, they are a Yes/No, each set contains 2 buttons and I use the question numbers under the name of link, for example the Question a 17, 4 sets of boxes for Yes/No to sub questions A, B, C and D, thus binding names Q17A, Q17B, etc..

    I've done every yes / no game needed, thought I want their answer Yes or no for part A, B, C and D, each.  By making the final test, when I click on send, he said to the less mandatory field was empty export.  I answered each question if necessary or not, thinking I can I have had a few errors in the mandatory fields, always got the error, then divided the form on 8 separate test documents, each containing only a single page and page 9 to submit in order to reduce it to which pages/fields were the cause of the problem.  On pages that have no radio buttons, only the required text responses, I don't have the message.  Only on pages with the radio buttons is I got the message "at least a necessary field was empty", which brings me to ask me what Miss me about the production of the required radio buttons.  In the Help menu of option buttons, but not this aspect, I found a lot, and maybe I went beside her and would appreciate any help, thanks.

    Hello

    Radio buttons can sometimes give wrong when it is set to required: see here Re: required Radio button red color in a dynamic form

    One thing to make sure is each Yes/No is a group of radio exclusion and the exclusion of the radio has the required value:

    Good luck

    Niall

  • Form - radio buttons

    I built a form and it has 6 sets (each set is 2 button - as Yes or no) radio button.

    I have tested the page, checked a box radio - everything was fine, but then why I tried to tick another box of radio, the last obtained box unchecked.

    And I said that I ment to build 6 sets of radio buttons and not 1 set of 12 keys.

    Here is the code:

    < form id = "form1" name = "form1" method = "post" action = "" >
    < fieldset >
    < legend > CBA < / legend >
    < label > ABC
    < select name = "select1" id = "select1" >
    < option value = "a" > AA < / option >
    < option value = "b" > BB < / option >
    < option value = 'c' > CC < / option >
    < option value = "d" > JJ < / option >
    < option value = 'e' > EE < / option >
    < option value = "f" > FF < / option >
    < / select >

    1
    < input type = "radio" name = "RadioGroup1" value = "1" / >
    2
    < input type = "radio" name = "RadioGroup1" value = "2" / >
    < br / >
    < / label >
    < label > ABC
    < select name = "select2" id = "select2" >
    < option value = "a" > aa < / option >
    < option value = "b" > bb < / option >
    < option value = 'c' > cc < / option >
    < option value = "d" > JJ < / option >
    < option value = 'e' > ee < / option >
    < option value = "f" > ff < / option >
    < / select >
    1
    < input type = "radio" name = "RadioGroup1" value = "1" / >
    2
    < input type = "radio" name = "RadioGroup1" value = "2" / > < / Label >
    < br / >
    < label > ABC
    < select name = "select3" id = "select3" >
    < option value = "a" > aa < / option >
    < option value = "b" > bb < / option >
    < option value = 'c' > cc < / option >
    < option value = "d" > JJ < / option >
    < option value = 'e' > ee < / option >
    < option value = "f" > ff < / option >
    < / select >
    1
    < input type = "radio" name = "RadioGroup1" value = "1" / >
    2
    < input type = "radio" name = "RadioGroup1" value = "2" / > < / Label >
    < br / >
    < label > ABC
    < select name = "select4" id = "select4" >
    < option value = "a" > aa < / option >
    < option value = "b" > bb < / option >
    < option value = 'c' > cc < / option >
    < option value = "d" > JJ < / option >
    < option value = 'e' > ee < / option >
    < option value = "f" > ff < / option >
    < option value = 'g' > gg < / option >
    < / select >
    1
    < input type = "radio" name = "RadioGroup1" value = "1" / >
    2
    < input type = "radio" name = "RadioGroup1" value = "2" / > < / Label >
    < br / >
    < label > ABC
    < select name = "choisies5" id = "choisies5" >
    < option value = "a" > aa < / option >
    < option value = "b" > bb < / option >
    < option value = 'c' > cc < / option >
    < option value = "d" > JJ < / option >
    < option value = 'e' > ee < / option >
    < option value = "f" > ff < / option >
    < option value = 'g' > gg < / option >
    < / select >
    1
    < input type = "radio" name = "RadioGroup1" value = "1" / >
    2
    < input type = "radio" name = "RadioGroup1" value = "2" / > < / Label >
    < br / >
    < label > ABC
    < select name = "select6" id = "select6" >
    < option value = "a" > aa < / option >
    < option value = "b" > bb < / option >
    < option value = 'c' > cc < / option >
    < option value = "d" > JJ < / option >
    < option value = 'e' > ee < / option >
    < option value = "f" > ff < / option >
    < option value = 'g' > gg < / option >
    < / select >

    1
    < input type = "radio" name = "RadioGroup1" value = "1" / >
    2
    < input type = "radio" name = "RadioGroup1" value = "2" / > < / Label >
    < / fieldset >

    < fieldset >
    CDE < legend > < / legend >
    < p >
    < label > a
    < input name = "name" type = "text" id = "name" / >
    < / label >
    < br / >
    b < label >
    < input name = "password" type = "password" id = "password" maxlength = "6" / >
    < / label >
    < br / >
    < /p > < / fieldset >
    < p > < / p >
    < fieldset >
    SR < legend > < / legend >
    < p >
    s < label >
    < input type = "submit" name = "Submit" value = "Submit" / >
    < / label >

    r < label >
    < input type = "reset" name = "Submit2" value = "Reset" / >
    < / label >
    < /p >
    < / fieldset >
    < / make >




    AirParker wrote:
    > I have tested the page, checked a box radio - everything was fine, but
    > so why I tried to tick another box of radio, the last box got
    > uncontrolled.


    1 >
    >
    2 >
    >

    >
    2 >
    >

    >
    2 >
    >

    All your radio buttons are in the same group - RadioGroup1. Only radio
    button in a group can be selected.

    Solution: Name of the first pair "RadioGroup1", then the second pair
    'RadioGroup2' etc, and everything will be fine.

    HTH,

    Pete.
    --
    Peter Connolly
    http://www.acutecomputing.co.UK
    Derby
    UK
    Skype ID: acutecomputing

  • How can I change a checkbox with a radio button?

    I downloaded a pdf file in Adobe Acrobat Pro DC.  The system automatically made some boxes as boxes and others like radio buttons.  I need to change the boxes to radio buttons as well as a selection can be selected on the lines crossing rather than the columns down.

    Hello well,.

    By default, EchoSign would read the fields of the form already added in the document (if available) and are presented in the same way. If you don't need boxes, then you will need to remove them and add radio buttons with EchoSign himself.

    -Usman

  • Boxes acting as radio buttons

    I have several checkboxes with the same name, the user can check only one in the list.  In the past, the user has the option to click a check box to clear it, leave all checkboxes deselected, because the form was when it was opened.  Now, they act like radio buttons; Once the user makes a choice, it is no way to click again and end with everything unchecked.  Is there an option I can change to make it work as before?  Or maybe a Javascript solution?

    My mistake, I let Acrobat automatically detects fields this time and forgot that radio buttons have been inserted instead of checkboxes.

    Thanks for your help George!

  • Could someone explain Radio button groups and how to identity, the individual borders in the name of the Group?

    I guess that there is a way to declare the name of the Group and then to identify the boxes of individual option within the group that way out put or "choice radio button: text that has been entered and is different from all the other within the same radio button group...»

    If you could point right to a tutorial that can help would be nice...

    Yes, myRadio is the name of the group. To get the correct number, which is determined by the order in which the individual radio buttons have been created (which can be different from their position, ordered on the page), you may need to use a bit of trial and error. The first is number 0 and you would increment from one to refer to the following.

Maybe you are looking for

  • 2 - IOS mobile devices can communicate with each other

    I have two Mobile IOS devices, the iPad (3rd generation) and I inherited an IPhone 4S.  I also have a MacBook 2.0 that I use to synchronize the iPad and manage my music in iTunes.   Before inheriting the iPhone, I created a number of events on the ca

  • Re: Wireless does not illuminate

    I have a problem with the WiFi, when iI use the radar to find the hot spots, I have connection in an olny to be informed that Ihave to activate wi - fi on via my key FN + F8, I do but when I release these buttons, he asks me do the same thing again a

  • Installed a new program. Cannot connect past welcome screen. Black screen of death. Connected with Safe Mode.

    After you install the program for my Logitech Quickcam 4000 computer asked me to restart. When I did I went to the login screen I have entered my password, but the only thing that's happened is he went to the 'Welcome' screen and the circle just kept

  • Cannot access account livemail

    Today, after installing a windows update, I can not on my account of livemail.  I tried to re set up, but I don't know the reception and sending of accounts for y7mail

  • RVS4000 lose network access and internet - reboot required

    I have recently bought a RVS4000 router and experience of major service disruptions. Almost daily router RVS4000 loss of internet connectivity. I noticed that when this happens, I can not connect on my pc which is connected to the network RVS4000 rou