Radio button groups
I created components in loops several times today, but the method does not work with the Radio button groups.Even if at each iteration, I create a new group, subsequently all buttons are in a single group as you can see:
<? XML version = "1.0" encoding = "utf-8"? >
"" < mx:Application xmlns:mx = ' http://www.adobe.com/2006/mxml ' xmlns = "" * "creationComplete ="initApp()">"
< mx:Script >
<! [CDATA]
Import mx.containers.HBox;
Import mx.controls.RadioButton;
Import mx.controls.RadioButtonGroup;
public function initApp (): void {}
var hb:HBox;
var rbg:RadioButtonGroup;
var rb: RadioButton;
var j: uint;
var label: String;
var rbarray:Array;
for (var i: uint = 0; i < 4; i ++) {}
HB = new HBox();
page.addChild (hb);
RBG = new RadioButtonGroup();
for (j = 0; j < 2; j ++) {}
RB = new RadioButton();
rb.groupName = "rbg".
{if (Boolean (j))}
label = "No";
} else {}
label = "Yes";
}
RB.label = label;
rb.labelPlacement = 'left ';
RB. Value = label;
rbarray.push (RB);
hb.addChild (rb);
}
RB = new RadioButton();
rb.groupName = "rbg".
RB.label = "no preference";
rb.labelPlacement = 'left ';
RB. Selected = true;
hb.addChild (rb);
}
}
[]] >
< / mx:Script >
< mx:Panel id = "page" width = "300" height = "150" / >
< / mx:Application >
Also, I like to keep the Radio button instance names in a table as I did before, but if you uncomment the line commented on this occasion you get an error.
Is it possible to build Radio button groups using a method of the loop?
And why can't I store the names of the buttons?
Doug
RadioButton.groupName setting only works if you give it the name of a group that is a child of the MXML document covering (ie. which means usually it is declared in the MXML). If you create the group dynamically, you need to assign the group directly. for example:
RB. Group = RGB;
And you get an error with the table because you don't instantiate rbarray (it is always set to null).
Tags: Flex
Similar Questions
-
APEX_ITEM - Radio button group does not work
Hi all
I have a classic report in my application
Report query:
SELECT APEX_ITEM.DISPLAY_AND_SAVE(8,B.PRIMARY_DLR_NUM||'-'||B.PRIMARY_DLR_NAME)|| APEX_ITEM.HIDDEN(9,A.ARM_EMPLID)|| APEX_ITEM.HIDDEN(10,A.AE_EMPLID)||APEX_ITEM.HIDDEN(11,B.PRIMARY_DLR_NUM)|| APEX_ITEM.HIDDEN(13,B.PRIMARY_DLR_NAME)|| APEX_ITEM.HIDDEN(12,B.DLR_TYPE_CD) "Dealer", C.DLR_STATUS "DLR_OPT_IN", C.ARM_STATUS "ARM_OPT_IN", C.AE_STATUS "AE_OPT_IN", C.ALT_ARM_MAIL_ID "ARM_EMAIL_ALT", C.ALT_AE_MAIL_ID "AE_EMAIL_ALT", C.ARM_STATUS "STATUS", C.APPROVED_DATE "APPVR_DATE" FROM EMPLOYEE_DEALER_RELATION A, DEALER B , EV_DR_ARM_AE_OVERRIDE C WHERE ((A.ARM_EMPLID= :P1_ARM AND A.AE_EMPLID = :P1_AE ) OR (B.DLR_TYPE_CD = :P1_DEALER_TYPE_CODE)) AND A.PRIMARY_DLR_NUM = B.PRIMARY_DLR_NUM AND A.PRIMARY_DLR_NUM = C.DEALER_ID AND A.ARM_EMPLID = C.ARM_ID AND A.AE_EMPLID = C.AE_ID
C.DLR_STATUS "DLR_OPT_IN"
C.ARM_STATUS "ARM_OPT_IN"
C.AE_STATUS "AE_OPT_IN"
These three columns are displayed in the Radio button group.
I have a process in the page that will insert a new record and update the existing record.
In the report, the user can change any column and press the submit call said above.
The process code:
DECLARE V_EXISTS NUMBER:=0; V_ERRMSG VARCHAR2(4000); V_ERRCODE VARCHAR2(100); BEGIN FOR I in 1..APEX_APPLICATION.G_F01.COUNT LOOP BEGIN BEGIN SELECT 1 INTO V_EXISTS FROM EV_DR_ARM_AE_OVERRIDE WHERE ARM_ID = APEX_APPLICATION.G_F09(I) AND AE_ID = APEX_APPLICATION.G_F10(I) AND DEALER_ID = APEX_APPLICATION.G_F11(I); EXCEPTION WHEN OTHERS THEN V_EXISTS:=0; END; IF V_EXISTS = 0 THEN INSERT INTO EV_DR_ARM_AE_OVERRIDE(ARM_ID,AE_ID,DEALER_ID,DEALER_NAME,DLR_STATUS,ARM_STATUS, AE_STATUS,ALT_ARM_MAIL_ID,ALT_AE_MAIL_ID,UPDATED_BY,UPDATED_DATE,APPROVAL_STATUS,APPROVED_BY, APPROVED_DATE,DEALER_TYPE_CODE) VALUES(apex_application.G_f09(I),apex_application.G_f10(I),apex_application.G_f11(I), apex_application.G_f13(I), APEX_APPLICATION.G_F01(I),APEX_APPLICATION.G_F02(I),APEX_APPLICATION.G_F03(I), APEX_APPLICATION.G_F04(I),APEX_APPLICATION.G_F05(I),:APP_USER,SYSDATE,APEX_APPLICATION.G_F06(I), :APP_USER,APEX_APPLICATION.G_F07(I),apex_application.G_f12(I)); COMMIT; ELSE UPDATE EV_DR_ARM_AE_OVERRIDE SET DLR_STATUS = APEX_APPLICATION.G_F02(I), ARM_STATUS = APEX_APPLICATION.G_F03(I), AE_STATUS = APEX_APPLICATION.G_F03(I), ALT_ARM_MAIL_ID = APEX_APPLICATION.G_F04(I), ALT_AE_MAIL_ID = APEX_APPLICATION.G_F05(I), UPDATED_BY = :APP_USER, UPDATED_DATE = SYSDATE, APPROVAL_STATUS = APEX_APPLICATION.G_F06(I), APPROVED_BY = :APP_USER WHERE ARM_ID = APEX_APPLICATION.G_F09(I) AND AE_ID = APEX_APPLICATION.G_F10(I) AND DEALER_ID = APEX_APPLICATION.G_F11(I); COMMIT; END IF; EXCEPTION WHEN OTHERS THEN V_ERRMSG:=SQLERRM; V_ERRCODE:=SQLCODE; INSERT INTO EVANTAGE_ERROR_LOG VALUES(APEX_APPLICATION.G_F09(I)||'-'||APEX_APPLICATION.G_F10(I) ||'-'||APEX_APPLICATION.G_F11(I),V_ERRMSG,V_ERRCODE,:APP_USER,SYSDATE); COMMIT; END; END LOOP; EXCEPTION WHEN OTHERS THEN V_ERRMSG:=SQLERRM; V_ERRCODE:=SQLCODE; INSERT INTO EVANTAGE_ERROR_LOG VALUES(NULL,V_ERRMSG,V_ERRCODE,:APP_USER,SYSDATE); COMMIT; END;
Now my problem is when I select radio group value and press on submit I get my process performing perfectly 404 page not found, its not even call my process, without radio button (if am not choose any NULL - value).
Could you get it someone please let me know how I can solve or what I missed here?
Thanks in advance.
See you soon,.
San.
Groups of radio in the reports are evil - this is inherent in the HTML format, like checkboxes in tabular form.
Vincent Deelen: Using radio buttons in a report of the APEX
My suggestion is to try a different design of the user interface, or generate buttons to replicate radio groups.
-
How can I count the number of filled Radio button groups?
Hello
I am working on a form that some calculations. The form contains ten groups of option buttons. Part of the necessary calculations is to multiply the number of times 10 filled radio button groups. I need the form to add groups of how the user is finished. So if the user has ticked a box in 7 groups, but not in the other 3, then the value could be set to 7, then later multiplied by ten. I have no problem with the multiply by ten party. I need help to find a way to get the total number of groups done button.
I think I could get by if I could test if a field group includes a box ticked or not. I could work with this base script:
var v1 = + getField("Section_1").value;
If (v1 < 0) {}
Event.Value = "rubbish";
} else {}
Event.Value = v1;
}
But it does not work. Does anyone know how to test if a button group has a value? Or how to test if it is "NaN"? Or if not how to calculate the total number of groups button? Any help would be greatly appreciated. I did some research for it on other forums but have not yet found a thread for this topic. Apologies if I forgot the advice in this topic.
The following code works. I don't know if it's the easiest or most efficient way, but it does the trick:
var T1 = 0;
var v1 = + getField("Section_1").value;
var v2 = + getField("Section_2").value;
var v3 = + getField("Section_3").value;
var v4 = + getField("Section_4").value;
V5 var = + getField("Section_5").value;
var V6 = + getField("Section_6").value;
v7 var = + getField("Section_7").value;
var V8 = + getField("Section_8").value;
var = v9 + getField("Section_9").value;
V10 var = + getField("Section_10").value;
If (v1 > = 0 & v1)<= 5="" )="">=>
T1 = t1 = 1;
}
If (v2 > = 0 & v2)<= 5="" )="">=>
T1 = t1 + 1;
}
If (v3 > = 0 & v3)<= 5="" )="">=>
T1 = t1 + 1;
}
If (v4 > = 0 & v4)<= 5="" )="">=>
T1 = t1 + 1;
}
If (v5 > = 0 & v5)<= 5="" )="">=>
T1 = t1 + 1;
}
If (v6 > = 0 & v6)<= 5="" )="">=>
T1 = t1 + 1;
}
If (v7 > = 0 & v7)<= 5="" )="">=>
T1 = t1 + 1;
}
If (v8 > = 0 & v8)<= 5="" )="">=>
T1 = t1 + 1;
}
If (v9 > = 0 & v9)<= 5="" )="">=>
T1 = t1 + 1;
}
If (v10 > = 0 & v10)<= 5="" )="">=>
T1 = t1 + 1;
}
Event.Value = t1;
-
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;
-
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.
-
Radio button group made mandatory
Hi all
I need to make a mandatory radio button group. Group of radio buttons have options like Yes, no, na for a particular issue, if the user does not choose either people, I need to trigger an error message.
I put Yes required point group of radio ownership, but still it does not work. Please let me know if I'm missing something.
Thanks in advance.
Kind regards
Rajesh SM.As Anil has suggested the prompt else it will not able to show the name of the element.
Kind regards
Out Sharma -
Disable certain value in the Radio button group
Hello
Is it possible to have a group of radio buttons but have certain values with disabilities while they are displayed but cannot be selected while other values in the Group of radio buttons are selectable.
I know that I could have two groups of radio next to each one showing the selectable values and another next to it showing disabled values but I'd rather have a radio group so that the values are in order.
We currently use apex 4.2.5.00.08
Thanks in advance
where to enjoy a group of radio buttons with three values
Yes, no, both
so it's the two of us, without deactivation function
-on your condition
real action in dynamic action
run javascript
$("#P2_CHOOSE_STATUS_"+0).attr ("disabled", true);
$("#P2_CHOOSE_STATUS_"+1).attr ("disabled", true);
P2_CHOOSE_STATUS IS THE NAME OF THE ELEMENT
-
Radio buttons in a radio button group
I have a radio group that gets the answer of the user for a yes or no or na the number of option buttons may depend on the checklist of the entries by the user. For ex, if the user enters the name of the checklist as 'Funding' - it would display 36 questions by 'No' as a default. If the user selects changes the value of the 1st radio button for personal details (ie. index 0), I wanted the buttons 5 radio following for other default issues the value selected for the 1st radio button. If the user selects Yes or n/a for the 6th option for the ADDRESS, then should they are assigned to 5 boxes according to the value in box 6 and this continues.
Please let me know how to read through the radio buttons and assign values.
Hello
So that's a block of retail, and you want the features may be impelemented for 6, 12, 18 etc. right option button?
If Yes, then you can find it using the MOD function so, try something below.
DECLARE Str_Value VARCHAR2(20); BEGIN IF MOD(:SYSTEM.CURSOR_RECORD, 6) = 0 THEN Str_Value := :
. ; FOR Num_Loop_I IN 1..4 LOOP NEXT_RECORD; : . := Str_Value; END LOOP; END IF; END; Manu.
-
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.
-
PDF forms interactive Adobe Indesign - Radio button groups
I am trying to create an interactive form in Indesign. When I create selection of different lines with the radio button options. When I export PDF all radio buttons respond to each all the different lines. Is it possible to group together them I'm not finding where only the keys for the turn on and off specific issue and not all the lines with different questions. They seem to be all connected. I'm sure I'm missing a setting or a way to isolate a group form another, but I can't understand it. Thank you.
Give those you want to act as a group of the same name.
-
Length (number of elements) radio button group
Hi all
Can you help me please to get a radio group, for example the P2_RADIO, the number of elements in javascript.
P2_RADIO is based on dynamic LOV and after refresh event, I need to check the number of items and apply logic.
Also please help me to click on a first group of Radio buttons element using jQuery.
Thank you very much
Andrei
You need DA [type = "when updating', selection ="your article"] and execute custom javascript that should look like
elem var = $(this.triggeringElement);
var radioNo = elem.find(':input[type=radio]').size();)
If (radioNo > 0) {}
elem. Find(':Radio:first'). Trigger ('click');
}
If (radioNo > 0) {}
make a logic if more then 0 radio entered
}
the code written down without trial so he can have syntax errors. Please let me know if you need help more :-)
Concerning
Bartosz
Post edited by: ostrowskibartosz
-
Hello
This seems to be a common question and I found a few answers but it doesn't seem to work for me.
I have a form (form1), and 3 (page 3) page, I have a table with a group of option buttons (9 groups of option buttons 3). I wrapped my radio buttons in a subform, which I have called "comparison".
I added a button to clear the table and the table (all 9 groups):
I added this code to the button:
xfa.host.resetData ("form1.page 3.Comparison");
Show: click *, language is javascript, run: the customer
When I test it, the button deletes the entire form (all pages).
What Miss me?
Thank you!
Caroline
Hi Carolina,.
Try to declare a variable with the full SOM Expression for the container and then it go to resetData method. The following is for the reason that the reset button is located in the subform of comparison.
// reset information in this subform only var f1 = this.parent.somExpression; xfa.host.resetData(f1);
See an example here: http://assure.ly/jcHEyc.
Hope that helps,
Niall
-
Radio button group can select Yes.
I have a radio with two buttons group, a Yes and the other no. At the moment he only let me the user select the Yes option button. I checked the hierarchy and both are included in the RadioButtonList method.
Any ideas on that?
Thank you
MDawn
Thanks for your reply. I replaced those who weren't working with a copy of a game that works very well and all now work correctly. I could not reproduce the problem.
Margaret Dawn
-
After you have clicked radio button I see the following error:
TypeError: Error #1009: Cannot access a property or method of a null object reference. at fl.controls::RadioButton/drawFocus() at fl.core::UIComponent/focusInHandler()
I used the following code:
import fl.controls.RadioButtonGroup
public class CoinToss extends MovieClip { var radioGroup1:RadioButtonGroup=new RadioButtonGroup("Coin Loss");
//constructor public function CoinToss() { //changing existing cursor to our custom Mouse.hide(); addEventListener(Event.ENTER_FRAME, myCursor); my_cursor.mouseEnabled = false; gameMenu(); }
public function gameMenu():void { gotoAndStop('homeScreen'); homeBtn.addEventListener(MouseEvent.CLICK, homeScreen); playGameBtn.addEventListener(MouseEvent.CLICK, gameScreen);
public function gameScreen(event:MouseEvent):void { startGame(); }
public function chooseAnswersGroup():void { gameScreen_mc.eagle_rb.group = radioGroup1; gameScreen_mc.tails_rb.group = radioGroup1; } function startGame():void { gotoAndStop('gameScreen'); var gameScreen:Tween = new Tween(gameScreen_mc, "x", Elastic.easeOut, -200, 10, 2, true); chooseAnswersGroup(); gameScreen_mc.eagle_rb.selected = true;
so if I choose the eagle_rb or tails_rb of the early radio button I see error
I click the chosen answer existing button of Pentecost (gameScreen_mc.eagle_rb.selected = true ;) then everything works fine
can anyone help please?
Hello
I went through your code it works fine, I found I think that the problem is with the component can you pls delete the part from your lib. and re import in your lib.
-
Best use of an option button n/d in collaboration with radio button groups.
Hello
I'm really new to LiveCycle ES, I would be too embarrassed to tell you how I came across this app. I've attached a screenshot of a such question survey designed by our sales team. Ideally, they want formulate me the answers to the question in such a way that the response of n/d, if selected by the user, does not allow other radio buttons on the same line selection. Each group is a group of exclusion so that in each category is allowed that one answer, I built. The problem is that the N/A option is its own group of radio buttons and cannot be deselected.
Someone has advice on how to manage a radio button option N/A or may suggest a completely alternative way to handle this. Its better if you look at the screen shot to see how hokey, it's really.
Thank you
Julie
Julie,
You copied my script, but did not change the names of path for the form variables. My root of form was 'form1 '. The root of your form is "SupplierSurvey".
In addition, two variable shape rules of naming conventions: don't use dots (.) and don't use hyphens (-).
I've renamed "on Page4-SurveyStart" to "Page4_SurveyStart" and removed the '. 1' extension of groups radio button exclusion to point 1.1. Accordingly, the code works for section 1.1 and you need to make the changes to the other sections.
Steve
Maybe you are looking for
-
Setting up RAID 1 on new want 700
I can't understand how to configure my new HP Envy 700 - 200z for RAID 1. I ordered it with 2 matching records and told me before that I ordered that this device supports RAID 1. PC running Windows 8.1. Then I converted the readers to dynamic ND, bu
-
Please help me... HP Pavilion 15-bc004nt (X0L73EA) has he fan, Double or Single?
-
Messgae keeps the problem with the print head. Manually clean the print head and ran the test. The test works very well. Next time the printer is used the same message appears.
-
Can I exchange a my G62 laptop HD in my notebook G61?
Hello My motherboard in my laptop G62 is a friend. However, the hard drive is good and is full of win8.1. I would trade this HD in my notebook G61 currently running win7. Are there any problems I should be aware of before to do this swap?
-
1 HP LaserJet CM1415fnw 2 mac OSX 10.7.4 3. message: "the selected folder is not writable" when try to scan in color, scans OK in black and white