Add/Remove radio buttons programatically

Dear All,
Is there any way to add/remove radio buttons programatically ?
Thanks,
Ritesh

Hi,
if your VI is running, you can't modify it
but it is possible to hide and display controls or indicators programmaticaly with the Property Node "Visible"

Similar Messages

  • Add a radio button to each row on output (not selection-screen)

    its a normal interacitve report...
    we need to add a radio button to each row on output (not selection-screen) and when user selects the radio button of a particular row and clicks on the user defined menu 'Execute' the report has to fetch the records from a table corresponding to the selected row on the second list.
    all this has to be done in normal interactive list.
    please let me know your suggetions as soon as possible.
    thanks,
    usha.

    Hi ,  try this
    TABLES: spfli.
    TYPE-POOLS:slis.
    PARAMETERS: p_col TYPE i ,
                p_row TYPE i,
                p_color(4) TYPE c .
    DATA: t_fieldcat TYPE slis_t_fieldcat_alv,
          fs_fieldcat LIKE LINE OF t_fieldcat,
          fs_layout TYPE slis_layout_alv ,
          w_color(4) ,
          w_row TYPE i,
          w_fieldname(20),
          w_prog TYPE sy-repid.
    TYPES : BEGIN OF ty_spfli ,
              color(4),
              checkbox ,
              cell TYPE slis_t_specialcol_alv,
              carrid TYPE spfli-carrid,
              connid TYPE spfli-connid,
              cityfrom TYPE spfli-cityfrom,
              cityto TYPE spfli-cityto,
              distance TYPE spfli-distance,
           END OF ty_spfli.
    DATA : wa_spfli TYPE ty_spfli ,
           t_spfli TYPE TABLE OF ty_spfli.
    DATA: fs_cell LIKE LINE OF wa_spfli-cell.
    SELECT carrid connid cityfrom cityto distance
      FROM spfli
      INTO CORRESPONDING FIELDS OF TABLE t_spfli.
    w_color = p_color.
    fs_fieldcat-fieldname = 'CARRID'.
    fs_fieldcat-ref_tabname = 'SPFLI'.
    fs_fieldcat-col_pos = 1.
    fs_fieldcat-key = 'X'.
    APPEND fs_fieldcat TO t_fieldcat.
    CLEAR fs_fieldcat .
    fs_fieldcat-fieldname = 'CONNID'.
    fs_fieldcat-ref_tabname = 'SPFLI'.
    fs_fieldcat-col_pos = 2.
    fs_fieldcat-key = 'X'.
    APPEND fs_fieldcat TO t_fieldcat.
    CLEAR fs_fieldcat .
    fs_fieldcat-fieldname = 'DISTANCE'.
    fs_fieldcat-ref_tabname = 'SPFLI'.
    fs_fieldcat-col_pos = 3.
    fs_fieldcat-key = ' '.
    fs_fieldcat-edit = 'X'.
    APPEND fs_fieldcat TO t_fieldcat.
    CLEAR fs_fieldcat.
    fs_fieldcat-fieldname = 'CITYFROM'.
    fs_fieldcat-ref_tabname = 'SPFLI'.
    fs_fieldcat-col_pos = 4.
    fs_fieldcat-key = ' '.
    APPEND fs_fieldcat TO t_fieldcat.
    LOOP AT t_fieldcat INTO fs_fieldcat.
      IF fs_fieldcat-col_pos EQ p_col.
        fs_fieldcat-emphasize = p_color.
        w_fieldname = fs_fieldcat-fieldname.
        IF p_row IS INITIAL AND p_col GT 0.
          MODIFY t_fieldcat FROM fs_fieldcat TRANSPORTING emphasize.
        ENDIF.
      ENDIF.
    ENDLOOP.
    fs_layout-info_fieldname = 'COLOR'.
    fs_layout-box_fieldname = 'CHECKBOX'.
    fs_layout-coltab_fieldname = 'CELL'.
    fs_layout-f2code = '&ETA'.
    w_prog = sy-repid.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        i_callback_program = w_prog
        is_layout          = fs_layout
        it_fieldcat        = t_fieldcat
      TABLES
        t_outtab           = t_spfli
      EXCEPTIONS
        program_error      = 1
        OTHERS             = 2.
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Regards,
    Aby

  • CRM Survey - How to remove Radio button defaults.

    Hi experts,
    I am trying to remove Radio button default. By default it is selected when I am trying to set attribute for answer options. Even if I unchecked, it reverts and set as selected again. Actually, I need remove Radio button default for the customer sees a response pre filled.
    Please advise on how can I remove Radio button default for answer options.
    Banu

    Hi,
    I see it now.
    You need to change the config of your radio buttons in the transaction itself.
    Goto CRM_SURVEY_SUITE, locate your survey, click on the change button ( a pencil) this will take you to the survey configuration.
    There navigation to the section in the left hand pane that corresponds to the radio buttons. And you will see Yes and No for answers to the questions. Double click on each of them to display on the right side work area and change the property 'Selected' (which is a check box) to unchecked.
    This should be easy.
    Regards
    Prasenjit

  • Add more radio buttons to quiz template

    I am using the quiz template to make a quiz. I want more than
    2 radio buttons ,how can I add them.

    quote:
    Originally posted by:
    umr
    I am using the quiz template to make a quiz. I want more than
    2 radio buttons ,how can I add them.
    Hello, if you are using MX 2004 (probably is the same for
    other versions) then you have to do like this:
    Go to keyframe where you see the radio buttons, right click
    in the radio buttons area and select "edit in place", you will get
    inside that clip and now you can copy/paste the radio buttons in
    the stage to create more buttons.

  • How to dynamically add/remove a button from the ribbon based on some condition? (Ribbon XML)

    Hi,
    I have a ribbon (done using ribbon XML) with menu options. I need to remove few buttons from the menu dynamically based on some condition. Also, I want to change the label of another button. How to achieve this programmatically? (C#)
    Thanks in advance.
    Thanks Prasad

    Hello Prasad,
    Use callbacks for populating Ribbon controls such as menu, dropDown, gallery and etc. Then you can use the
    Invalidate or
    InvalidateControl methods of the
    IRibbonUI interface to get your callbacks invoked when required. Thus, you will be able to delete the required item(s).
    You will find the following articles in MSDN helpful:
    Chapter 11: Creating Dynamic Ribbon Customizations (1 of 2)
    Chapter 11: Creating Dynamic Ribbon Customizations (2 of 2)
    To change the label of your controls at runtime you need to use the getLabel callback and call the Invalidate or InvalidateControl methods of the IRibbonUI interface. The following series of articles describe the Fluent UI in depth:
    Customizing the 2007 Office Fluent Ribbon for Developers (Part 1 of 3)
    Customizing the 2007 Office Fluent Ribbon for Developers (Part 2 of 3)
    Customizing the 2007 Office Fluent Ribbon for Developers (Part 3 of 3)

  • Need some help getting add/remove field buttons working

    Someone here on the forums had previously assisted me with getting a button set up on a form that would add an additional text field to a form.  I now need a separate button created that will delete a text field in case too many were added.  I am hoping that someone can assist me with this since my XML knowledge is pretty much nil.  It doesn't look like I can upload files to the forum here, so I am going to attempt to paste my code.  I just need to get the "-" button to subtract a row.  Thanks in advance for the assistance.
    -Chris
    <?xml version="1.0" encoding="UTF-8"?>
    <?xfa generator="AdobeLiveCycleDesignerES_V8.2.1.4029.1.523496" APIVersion="2.8.9029.0"?>
    <xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/" timeStamp="2010-06-28T16:04:04Z" uuid="081329f3-4914-4dde-87ae-75a83da8434e">
    <template xmlns="http://www.xfa.org/schema/xfa-template/2.6/">
       <?formServer defaultPDFRenderFormat acrobat8.1static?>
       <subform name="form1" layout="tb" locale="en_US">
          <pageSet>
             <pageArea name="Page1" id="Page1">
                <contentArea x="19.05mm" y="12.7mm" w="190.5mm" h="266.7mm"/>
                <medium stock="default" short="612pt" long="792pt"/>
                <?templateDesigner expand 1?></pageArea>
             <?templateDesigner expand 1?></pageSet>
          <subform w="7.5in" h="10.5in" name="Page1">
             <subform w="174.625mm" y="79.377mm" name="Current_Objectives" layout="tb">
                <subform w="174.625mm" h="9.522mm" name="Objective">
                   <field name="txt_currobj" minH="8.263mm" w="174.625mm">
                      <ui>
                         <textEdit multiLine="1">
                            <border>
                               <?templateDesigner StyleID aped3?>
                               <edge stroke="lowered"/>
                            </border>
                            <margin/>
                         </textEdit>
                      </ui>
                      <font size="11pt" typeface="Verdana"/>
                      <margin topInset="1mm" bottomInset="1mm" leftInset="1mm" rightInset="1mm"/>
                      <para vAlign="middle"/>
                      <caption reserve="7.76mm">
                         <para vAlign="middle"/>
                         <value>
                            <text>1.</text>
                         </value>
                         <font size="11pt" typeface="Verdana"/>
                      </caption>
                      <event activity="initialize" name="event__initialize">
                         <script contentType="application/x-javascript">this.caption.value.text.value = (this.parent.index + 1) + "."
    </script>
                      </event>
                   </field>
                   <occur max="-1"/>
                   <?templateDesigner expand 1?></subform>
                <field h="5.08mm" name="curr_obj_add_line" w="5.08mm">
                   <ui>
                      <button highlight="push"/>
                   </ui>
                   <font typeface="Arial"/>
                   <caption>
                      <value>
                         <text>+</text>
                      </value>
                      <para hAlign="center" vAlign="middle"/>
                      <font typeface="Arial"/>
                   </caption>
                   <border hand="right">
                      <edge stroke="raised"/>
                      <fill>
                         <color value="212, 208, 200"/>
                      </fill>
                      <?templateDesigner StyleID apbx2?></border>
                   <bind match="none"/>
                   <assist>
                      <toolTip>Add an item</toolTip>
                   </assist>
                   <event activity="click" name="event__click">
                      <script contentType="application/x-javascript">
    _Objective.addInstance(1)
    </script>
                   </event>
                </field>
                <field h="5.08mm" name="curr_obj_del_line" w="5.08mm">
                   <ui>
                      <button highlight="push"/>
                   </ui>
                   <font typeface="Arial"/>
                   <caption>
                      <value>
                         <text>-</text>
                      </value>
                      <para hAlign="center" vAlign="middle"/>
                      <font typeface="Arial"/>
                   </caption>
                   <border hand="right">
                      <edge stroke="raised"/>
                      <fill>
                         <color value="212,208,200"/>
                      </fill>
                      <?templateDesigner StyleID apbx2?></border>
                   <bind match="none"/>
                   <assist>
                      <toolTip>Delete an item</toolTip>
                   </assist>
                   <event activity="click" name="event__click">
                      <script contentType="application/x-javascript">
    _Objective.deleteInstance(1)
    </script>
                   </event>
                </field>
                <?templateDesigner expand 0?></subform>
             <?templateDesigner expand 1?></subform>
          <desc>
             <text name="version">8.2.1.4029.1.523496.503679</text>
          </desc>
          <?templateDesigner expand 1?></subform>
       <?templateDesigner DefaultLanguage FormCalc?>
       <?templateDesigner DefaultRunAt client?>
       <?acrobat JavaScript strictScoping?>
       <?templateDesigner Zoom 100?>
       <?templateDesigner Grid show:1, snap:1, units:0, color:ff8080, origin:(0,0), interval:(125000,125000)?>
       <?templateDesigner FormTargetVersion 26?>
       <?templateDesigner SaveTaggedPDF 1?>
       <?templateDesigner SavePDFWithEmbeddedFonts 1?>
       <?templateDesigner Rulers horizontal:1, vertical:1, guidelines:1, crosshairs:0?></template>
    <config xmlns="http://www.xfa.org/schema/xci/2.6/">
       <agent name="designer">
          <destination>pdf</destination>
          <pdf>
             <!--  [0..n]  -->
             <fontInfo/>
          </pdf>
       </agent>
       <present>
          <!--  [0..n]  -->
          <pdf>
             <!--  [0..n]  -->
             <version>1.7</version>
             <adobeExtensionLevel>1</adobeExtensionLevel>
          </pdf>
          <common/>
          <script>
             <runScripts>server</runScripts>
          </script>
          <xdp>
             <packets>*</packets>
          </xdp>
       </present>
       <?originalXFAVersion http://www.xfa.org/schema/xci/2.8/?></config>
    <localeSet xmlns="http://www.xfa.org/schema/xfa-locale-set/2.6/">
       <?originalXFAVersion http://www.xfa.org/schema/xfa-locale-set/2.6/?>
       <locale name="en_US" desc="English (United States)">
          <calendarSymbols name="gregorian">
             <monthNames>
                <month>January</month>
                <month>February</month>
                <month>March</month>
                <month>April</month>
                <month>May</month>
                <month>June</month>
                <month>July</month>
                <month>August</month>
                <month>September</month>
                <month>October</month>
                <month>November</month>
                <month>December</month>
             </monthNames>
             <monthNames abbr="1">
                <month>Jan</month>
                <month>Feb</month>
                <month>Mar</month>
                <month>Apr</month>
                <month>May</month>
                <month>Jun</month>
                <month>Jul</month>
                <month>Aug</month>
                <month>Sep</month>
                <month>Oct</month>
                <month>Nov</month>
                <month>Dec</month>
             </monthNames>
             <dayNames>
                <day>Sunday</day>
                <day>Monday</day>
                <day>Tuesday</day>
                <day>Wednesday</day>
                <day>Thursday</day>
                <day>Friday</day>
                <day>Saturday</day>
             </dayNames>
             <dayNames abbr="1">
                <day>Sun</day>
                <day>Mon</day>
                <day>Tue</day>
                <day>Wed</day>
                <day>Thu</day>
                <day>Fri</day>
                <day>Sat</day>
             </dayNames>
             <meridiemNames>
                <meridiem>AM</meridiem>
                <meridiem>PM</meridiem>
             </meridiemNames>
             <eraNames>
                <era>BC</era>
                <era>AD</era>
             </eraNames>
          </calendarSymbols>
          <datePatterns>
             <datePattern name="full">EEEE, MMMM D, YYYY</datePattern>
             <datePattern name="long">MMMM D, YYYY</datePattern>
             <datePattern name="med">MMM D, YYYY</datePattern>
             <datePattern name="short">M/D/YY</datePattern>
          </datePatterns>
          <timePatterns>
             <timePattern name="full">h:MM:SS A Z</timePattern>
             <timePattern name="long">h:MM:SS A Z</timePattern>
             <timePattern name="med">h:MM:SS A</timePattern>
             <timePattern name="short">h:MM A</timePattern>
          </timePatterns>
          <dateTimeSymbols>GyMdkHmsSEDFwWahKzZ</dateTimeSymbols>
          <numberPatterns>
             <numberPattern name="numeric">z,zz9.zzz</numberPattern>
             <numberPattern name="currency">$z,zz9.99|($z,zz9.99)</numberPattern>
             <numberPattern name="percent">z,zz9%</numberPattern>
          </numberPatterns>
          <numberSymbols>
             <numberSymbol name="decimal">.</numberSymbol>
             <numberSymbol name="grouping">,</numberSymbol>
             <numberSymbol name="percent">%</numberSymbol>
             <numberSymbol name="minus">-</numberSymbol>
             <numberSymbol name="zero">0</numberSymbol>
          </numberSymbols>
          <currencySymbols>
             <currencySymbol name="symbol">$</currencySymbol>
             <currencySymbol name="isoname">USD</currencySymbol>
             <currencySymbol name="decimal">.</currencySymbol>
          </currencySymbols>
          <typefaces>
             <typeface name="Myriad Pro"/>
             <typeface name="Minion Pro"/>
             <typeface name="Courier Std"/>
             <typeface name="Adobe Pi Std"/>
             <typeface name="Adobe Hebrew"/>
             <typeface name="Adobe Arabic"/>
             <typeface name="Adobe Thai"/>
             <typeface name="Kozuka Gothic Pro-VI M"/>
             <typeface name="Kozuka Mincho Pro-VI R"/>
             <typeface name="Adobe Ming Std L"/>
             <typeface name="Adobe Song Std L"/>
             <typeface name="Adobe Myungjo Std M"/>
          </typefaces>
       </locale>
    </localeSet>
    <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 4.2.1-c041 52.337767, 2008/04/13-15:41:00        ">
       <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
          <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
             <xmp:MetadataDate>2010-06-28T16:04:04Z</xmp:MetadataDate>
             <xmp:CreatorTool>Adobe LiveCycle Designer ES 8.2</xmp:CreatorTool>
             <xmp:ModifyDate>2010-06-28T11:28:54-04:00</xmp:ModifyDate>
             <xmp:CreateDate>2010-06-18T11:45:23-04:00</xmp:CreateDate>
          </rdf:Description>
          <rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
             <pdf:Producer>Adobe LiveCycle Designer ES 8.2</pdf:Producer>
          </rdf:Description>
          <rdf:Description xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/" rdf:about="">
             <xmpMM:DocumentID>uuid:081329f3-4914-4dde-87ae-75a83da8434e</xmpMM:DocumentID>
             <xmpMM:InstanceID>uuid:4d9ea5d0-fbf1-4be5-8aa5-b9c828a765e9</xmpMM:InstanceID>
          </rdf:Description>
          <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" rdf:about="">
             <dc:format>application/pdf</dc:format>
          </rdf:Description>
          <rdf:Description xmlns:desc="http://ns.adobe.com/xfa/promoted-desc/" rdf:about="">
             <desc:version rdf:parseType="Resource">
                <rdf:value>8.2.1.4029.1.523496.503679</rdf:value>
                <desc:ref>/template/subform[1]</desc:ref>
             </desc:version>
          </rdf:Description>
       </rdf:RDF>
    </x:xmpmeta>
    <xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">
       <annots/>
    </xfdf></xdp:xdp>

    Hi,
    The (1) is incorrect for the removeInstance.
    In the addInstance script the (1) is for "true" - merge the new instance with the data model.
    In the removeInstance you need to specify which instance you want to remove.
    So in your button the script would look think this:
    var vCount = _Objective.count - 1;
    _Objective.removeInstance(vCount);
    This counts the number of instances and then subtracts 1, because the instances are zero based.
    I have also added a button within the repeating instance, which allows the user to select the instance they want to remove.
    _Objective.removeInstance(this.parent.index);
    The this.parent.index is telling Acrobat that the instance to delete is the one that the button is in.
    Form is here: https://acrobat.com/#d=nn2Ubo6tq5TDEcrtnz-SCg
    Good luck,
    Niall

  • To add radio buttons .

    Hello every one....
    I want to add 3 radio buttons in my module pool program.
    how is it possible.
    I need help....

    Hi Subhash...
    Open the Screen Layout
    Place three RADIO BUTTONS  on the Screen with Names : R1 , R2 , R3.
    You have to Group them
    First Drag around the Radiobutton and then select the menu path:
    EDIT->GROUPING->RADIOBUTTON GROUP->DEFINE.
    You have to declare single Char variable for each Radiobutton in TOP inclulde.
    DATA : R1, R2, R3.
    You can check them in PAI module like this
    CASE 'X'.
    WHEN R1.
    WHEN R2.
    WHEN R3.
    ENDCASE.
    <b>Reward if Helpful</b>

  • Adding Radio Button dynamically, twice - Error #2025: The supplied DisplayObject must be a child of

    Hello
    I am having some trouble adding UI controls dynamically. Mostly with radio buttons.
    Here is an example that demonstrates my problem:
    <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"
        creationPolicy="all"
        >
        <fx:Script>
            <![CDATA[ 
                import mx.containers.Form;
                import mx.containers.Panel;
                import mx.controls.Label;
                import mx.controls.NumericStepper;
                import mx.controls.RadioButton;
                private var theChar:String = "B";
                protected function btnAdd_clickHandler(event:MouseEvent):void
                    var theForm:Form = new Form();               
                    theForm.label = theChar;
                    //1. Label
                    var myLabel:Label = new Label();
                    myLabel.text = "My Label";
                    myLabel.width=120;
                    theForm.addChild(myLabel);
                    //2. Numeric Stepper
                    var myNumStepper:NumericStepper = new NumericStepper();
                    myNumStepper.id = "numPointHigh" + theChar;
                    myNumStepper.name = "numPointHigh" + theChar;
                    myNumStepper.minimum = 0;
                    myNumStepper.maximum = 120;
                    myNumStepper.width = 50;
                    myNumStepper.height = 30;
                    theForm.addChild(myNumStepper);
                    //3. radio button
                    var myRadioButton:RadioButton = new RadioButton;
                    myRadioButton.id = "myRadioButton" + theChar;
                    myRadioButton.name = "myRadioButton" + theChar;
                    myRadioButton.label = "my radio button";
                    myRadioButton.selected = true;
                    theForm.addChild(myRadioButton);
                    //4. Panel
                    var thePanel:Panel = new Panel();
                    thePanel.width = 300;
                    thePanel.height = 475;
                    thePanel.name=theChar;
                    thePanel.title = "My Profile Panel";
                    thePanel.setStyle("backgroundColor", "blue");
                    //add the form to the panel
                    thePanel.addChild(theForm);
                    //add the Panel to the list control
                    myList.addChild(thePanel);
                protected function btnClear_clickHandler(event:MouseEvent):void
                    var numChildren:Number = myList.numChildren;
                    for(var i:Number=numChildren - 1; i > -1; i--){
                        myList.removeChildAt(i);
            ]]>
        </fx:Script>
        <mx:VBox width="100%">
            <mx:List id="myList" />
            <mx:Button id="btnAdd" label="Add a panel" click="btnAdd_clickHandler(event)" color="black"/>
            <mx:Button id="btnClear" label="Clear" click="btnClear_clickHandler(event)" color="black" />
        </mx:VBox>
    </s:Application>
    ^ Run that. Click the "Add a panel" button. Then click "Clear". Then click the "Add a panel" button again. You will see the error:
    ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
        at flash.display::DisplayObjectContainer/getChildIndex()
        at mx.core::Container/getChildIndex()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core \Container.as:2833]
        at mx.containers::Panel/getChildIndex()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\co ntainers\Panel.as:1174]
        at mx.controls::RadioButtonGroup/breadthOrderCompare()[E:\dev\4.0.0\frameworks\projects\fram ework\src\mx\controls\RadioButtonGroup.as:600]
        at mx.controls::RadioButtonGroup/breadthOrderCompare()[E:\dev\4.0.0\frameworks\projects\fram ework\src\mx\controls\RadioButtonGroup.as:611]
        at mx.controls::RadioButtonGroup/breadthOrderCompare()[E:\dev\4.0.0\frameworks\projects\fram ework\src\mx\controls\RadioButtonGroup.as:611]
        at Array$/_sort()
        at Array/http://adobe.com/AS3/2006/builtin::sort()
        at mx.controls::RadioButtonGroup/http://www.adobe.com/2006/flex/mx/internal::addInstance()[E:\dev\4.0.0\frameworks\projects \framework\src\mx\controls\RadioButtonGroup.as:465]
        at mx.controls::RadioButton/addToGroup()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\c ontrols\RadioButton.as:574]
        at mx.controls::RadioButton/commitProperties()[E:\dev\4.0.0\frameworks\projects\framework\sr c\mx\controls\RadioButton.as:514]
        at mx.core::UIComponent/validateProperties()[E:\dev\4.0.0\frameworks\projects\framework\src\ mx\core\UIComponent.as:7772]
        at mx.managers::LayoutManager/validateProperties()[E:\dev\4.0.0\frameworks\projects\framewor k\src\mx\managers\LayoutManager.as:572]
        at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.0.0\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:730]
        at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.0.0\frameworks\projec ts\framework\src\mx\managers\LayoutManager.as:1072]
    I do not understand why I cannot re-add the radio button? If you comment out the code for the radio button (comment section #3.) you can re-add the panels easily. It is only happening when I have radio buttons being added to the form/panel.
    Why is this happening and how do I fix it? Why is this only happening to radio buttons? I thought I had this fixed

    ^ well, okay, but that's not the problem.
    here, i removed list and replaced with Panel. same problem on the radio buttons.
    <s:Application
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark" 
        xmlns:containers="com.dougmccune.containers.*"
        xmlns:mx="library://ns.adobe.com/flex/mx"
        creationPolicy="all"
        >
        <fx:Script>
            <![CDATA[ 
                import mx.containers.Form;
                import mx.containers.Panel;
                import mx.controls.Label;
                import mx.controls.NumericStepper;
                import mx.controls.RadioButton;
                private var theChar:String = "B";
                protected function btnAdd_clickHandler(event:MouseEvent):void
                    var theForm:Form = new Form();               
                    theForm.label = theChar;
                    //1. Label
                    var myLabel:Label = new Label();
                    myLabel.text = "My Label";
                    myLabel.width=120;
                    theForm.addChild(myLabel);
                    //2. Numeric Stepper
                    var myNumStepper:NumericStepper = new NumericStepper();
                    myNumStepper.id = "numPointHigh" + theChar;
                    myNumStepper.name = "numPointHigh" + theChar;
                    myNumStepper.minimum = 0;
                    myNumStepper.maximum = 120;
                    myNumStepper.width = 50;
                    myNumStepper.height = 30;
                    theForm.addChild(myNumStepper);
                    //3. radio button
                    var myRadioButton:RadioButton = new RadioButton;
                    myRadioButton.id = "myRadioButton" + theChar;
                    myRadioButton.name = "myRadioButton" + theChar;
                    myRadioButton.label = "my radio button";
                    myRadioButton.selected = true;
                    theForm.addChild(myRadioButton);
                    //4. Panel
                    var thePanel:Panel = new Panel();
                    thePanel.width = 300;
                    thePanel.height = 475;
                    thePanel.name=theChar;
                    thePanel.title = "My Profile Panel";
                    thePanel.setStyle("backgroundColor", "blue");
                    //add the form to the panel
                    thePanel.addChild(theForm);
                    //add the Panel to the list control
                    myContainer.addChild(thePanel);
                protected function btnClear_clickHandler(event:MouseEvent):void
                    var numChildren:Number = myContainer.numChildren;
                    for(var i:Number=numChildren - 1; i > -1; i--){
                        myContainer.removeChildAt(i);
            ]]>
        </fx:Script>
        <mx:VBox width="100%">
            <mx:Panel id="myContainer" />
            <mx:Button id="btnAdd" label="Add a panel" click="btnAdd_clickHandler(event)" color="black"/>
            <mx:Button id="btnClear" label="Clear" click="btnClear_clickHandler(event)" color="black" />
        </mx:VBox>
    </s:Application>
    Any idea why radio buttons causing this to happen? If I comment out the radio button, this works fine. This is really baffling me.
    The exception is thrown when the dynamically created panel (thePanel) is added to the main Panel (myContainer):
    myContainer.addChild(thePanel); <--- causes the exception!
    ^ Why would radio buttons make a difference on "thePanel"?? How can I enforce parent-child relationship, explicitly? .parent is read-only

  • How to enable a disabled radio button????

    Hi here is the problem i have, i have a number of radio buttons contained in a buton group, all the buttons bar the first one are disabled. The buttons are all drawn on a JPanel. What i want to be able to do is once the enabled button has been selected, I want to enable the next button in the gropu and also then disable the one that was previously enabled. Is there any way i can do this, below is the code i have for setting the group up, and trying the above probelm. Any help much appreciated Thanks.
    /* Function creates a radio button and adds it to the button group */
         public JRadioButton getRadioButton(String myString, boolean val)
              JRadioButton myButton=new JRadioButton(myString);
              myButton.setActionCommand(myString);
              myButton.addActionListener(myListener);
              myButton.setEnabled(val);
              group.add(myButton);
              return myButton;
    //adds the radio buttons to the panel, for each transition */
         public void addTranPan()
                   for(int i = 0; i < dCreate.char2.size(); i ++)
                   if (i == 0) mPanel.add(getRadioButton(dCreate.char2.elementAt(0).toString(),true));
                   else
    mPanel.add(getRadioButton(dCreate.char2.elementAt(i).toString(),false));
    public void ChangeButtonState()
    Component [] components = getContentPane().getComponents();
              for (int i = 0; i < components.length; i++)
                   Component c = components;
                   if (c instanceof JRadioButton)
                   JRadioButton rb = (JRadioButton) c;
                   rb.setEnabled(false);
                   if (c.getName().equals(ch)) //find button to enable
                   JRadioButton rb = (JRadioButton) c;
                   rb.setEnabled(true);
                   break;
              mPanel.repaint();

    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class sol21 extends JFrame implements ItemListener {
    JRadioButton
       radio1 = new JRadioButton("One"),
       radio2 = new JRadioButton("Two"),
       radio3 = new JRadioButton("Three"),
       radio4 = new JRadioButton("Four");
      JRadioButton[] radios = {
        radio1, radio2, radio3, radio4
      int INITIAL_ENABLED = 0;
      public sol21() {
        ButtonGroup group = new ButtonGroup();
        JPanel panel = new JPanel(new GridBagLayout());
        GridBagConstraints gbc = new GridBagConstraints();
        gbc.insets = new Insets(5,0,5,0);
        gbc.anchor = gbc.WEST;
        gbc.gridwidth = gbc.REMAINDER;
        for(int j = 0; j < radios.length; j++) {
          radios[j].addItemListener(this);
          group.add(radios[j]);
          panel.add(radios[j], gbc);
          if(j == INITIAL_ENABLED)
            continue;
          radios[j].setEnabled(false);
        setContentPane(panel);
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setSize(300,200);
        setLocation(300,200);
        setVisible(true);
      public void itemStateChanged(ItemEvent e) {
        JRadioButton button = (JRadioButton)e.getItemSelectable();
        if(e.getStateChange() == ItemEvent.SELECTED) {
          int index = 0;
          for(int j = 0; j < radios.length; j++)
            if(radios[j] == button)
              index = j;
          radios[(index + 1) % radios.length].setEnabled(true);
          if(index == 0)
            index = radios.length;
          radios[(index - 1) % radios.length].setEnabled(false);
      public static void main(String[] args) {
        new sol21();
    }

  • Adding radio button to each row of an interactive report: possible or not?

    First of all let me explain what the point of this application is.
    I'm making an application that allows a user to select something out of a drop-down select list. This list is a list of categories for food. Let's say the user selects "Fruit".
    Then the page refreshes and shows an interactive report with a list of food that belongs to the category of fruit.
    Here's where I want to change things:
    I want the user to see the interactive report, but in this interactive report I want to add a radio button for each row.
    Then, when a certain type of food is selected (let's say "Strawberry") via the radio button, a text field should appear underneath the interactive report. In this textfield, the user can then add the weight of the food item, and then it will calculate how many carbs there are in the strawberry.
    All I really want to know is:*
    How do I add a radio button to each row of the interactive report, and how do I link this radio button to the value of that particular row?*
    Additional information:
    The item "P17_FOOD_CATEGORY" contains the following LOV:
    select FOODCATEGORYNAME as display_value, FOODCATEGORYID as return_value
    from FOODCATEGORY
    order by 1
    The "Food" region contains the following source:
    select a.FOODID, a.NAME, b.FOODCATEGORYNAME, c.STANDARDAMOUNT, c.NAME Unit
    from FOOD a inner join FOODCATEGORY b
    on a.FOODCATEGORYID = b.FOODCATEGORYID join FOODUNIT c
    on a.FOODID = c.FOODID
    where a.FOODCATEGORYID = :P17_SET_CATEGORY
    EDIT:
    PLEASE! Even if you don't know a good answer or if you are unsure about your answer, do post! Even suggestions would be welcome! I really need all the help I could get, even if it's not much.
    Edited by: 917169 on Feb 29, 2012 12:25 AM

    Hi there!
    I tried to change my code to your version, but then I get an error message:
    Error Unable to change Interactive Report query.
    ORA-12899: value too large for column "APEX_040100"."WWV_FLOW_WORKSHEET_COLUMNS"."DB_COLUMN_NAME" (actual: 32, maximum: 30)
    I don't quite know what this means. After doing a quick search on the internet, I know that this message should mean that the length of the value for the columns named "APEX_040100", "WWV_FLOW_WORKSHEET_COLUMNS" and "DB_COLUMN_NAME" is too long. But, I don't have these columns. I searched for them in my object browser, and they can't be found in any table related to my application.
    I'm sure your answer is the solution, but do you perhaps have an idea on how to solve this error? I checked the allowed maximum length for any column value that is related to my application, but they all have "50" set as the maximum value...
    Thank you for your reply. ;)

  • Radio Buttons problem

    Hi i ahve developed a GUI with 2 toggle buttons options[0] and options[1],I have also created an "OK" Button.the programming is working fine ,but i now want to implement the action performed method.The user must select which option he/she wants and then click the ok button.I am not sure how to do this in the action performed method.the first button,cancels the ticking of any radio button (clears the readio buttons)and the second bottun exits
    here is my code so far
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    public class LogOut extends JFrame implements ActionListener{
    JRadioButton[] options = new JRadioButton[2];
    public LogOut(){
    super("Log Out?");
    setBounds(225,125,140,190);
    setDefaultCloseOperation(JFrame.Exit_ON_Close);
    options[0] = new JRadioButton("Log Out");
    options[0].addActionListener(this);
    options[1] = new JRadionButton("Cancel");
    options[1].addActionListener(this);
    JPanel pane = new JPanel();
    ButtonGroup group = new ButtonGroup();
    for(int i = 0; i < options.length; i++){
    group.add[options[i]);
    pane.add(teams);
    setContentPane;
    show();
    public static main void(String[] arguments){
    LogOut lo = new LogOut();
    public void actionPerformed(ActionEvent evt){
    Object source = evt.getSource()

    I understood it as you select a check box, and then when you click the button, it should do something based on what you have selected.
    So if you continue with the code I posted,
    public void actionPerformed(ActionEvent e) {
      // the button has been clicked:
      for (int x = 0; x < options.length; x++) {
        if (options[x].isSelected()) {
          // radio button at index 'x' has been selected.
          switch (x) {
            case 0: {
              options[x].setSelected(false); // the only radio button checked..
              break;
            case 1: {
              System.exit(0);
              break;
            default: {
              System.out.println("Not defined"); // will only occur if you add more radio buttons later.
          return;
      System.out.println("No radio buttons have been selected");
    }Or is what you really want, an action to start at the moment that you select/unselect a radio button without pressing the OK button?

  • Dynamic Radio Buttons

    am BRAND SPANKING NEW to java and I have a site (created by someone else obviously) which shows 2 text boxes dynamically depending on a number that is entered into the "NumAdults" box. So if you enter "2", you get:
    age.text box, tripcost.text box, age.text box, tripcost.text box
    What I'm trying to do, is add a radio button to the mix. For example, if you entered "2", I want it to show
    age.text box, tripcost.text box, member.radio button, age.text box, tripcost.text box, member.radio button.
    The code for the text boxes is working fine but the radio buttons won't work! The radio buttons are elements named rbmember1 through rbmember10. The code - (I've tried to add the radio buttons - please don't laugh) so far is as follows: - Please, can anyone see what I'm doing wrong here?
    txtNumAdults.Value = pol.Insureds.Count.ToString();
    hdnSelectedPlan.Value = pol.Pol.PlanCode;
    for(int i=0;i<pol.Insureds.Count;i++)
    TextBox txt = FindControl("txtAdultAge"+(i+1).ToString()) as TextBox;
    txt.Visible = true;
    txt.Text = pol.Insureds.Age.ToString();
    txt = FindControl("txtTripCost"+(i+1).ToString()) as TextBox;
    txt.Visible = true;
    txt.Text = pol.Insureds[i].TripCost.ToString("n");
    Radiobutton rb = FindControl("rbMember"+(i+1)) as RadioButton;
    rb.Visible = true;

    Well, it kind of looks like javascript to me.. (I didn't realize there was a difference!. . that's how new I am)

  • Radio Buttons for Flash PHP email.

    Hi.
    I need to add a sign-up form for services to a flash AS2 web site.
    I found a very simple example of a Flash/ PHP email form at Kirupa.
    It works fine, but I need to add some radio buttons.
    My web site will offer various services.
    Ideally I would like to be able for viewers to sign up for a service by clicking the appropriate right radio buttons
    F.ex;
    •   Service 1
    •   Service 2
    •   Service 3
    •   Service 4
    The email should reflect the choices made by listing the text on the selected services (radio buttons).
    Please download the FLA and the PHP file (at the bottom of the tutorial) here:
    http://www.kirupa.com/developer/actionscript/flash_php_email.htm
    I have uploaded a working version here:
    http://gggraphic.com/flash_mail/simple_flash_mail.php
    How do I add and script the radio buttons with both AS and the PHP to make it happen?
    Thank you on beforehand for your help
    ggaarde

    Hi Again
    Maybe check buttons would be a more natural option for this. You should be able to select more than one service.
    Thanks
    ggaarde

  • Adding Radio button & regular button to selection-screen without new gui

    Hi,
    Is there a way to add a radio button & regular button to a selection-screen without having to create a new gui, status and etc?
    Thanks,
    John

    Hi
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 4(30) TEXT-001 FOR FIELD P_1.
    SELECTION-SCREEN POSITION 1.
    PARAMETERS: P_1 RADIOBUTTON GROUP R1 DEFAULT 'X'.
    SELECTION-SCREEN END   OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 4(30) TEXT-002 FOR FIELD P_2.
    SELECTION-SCREEN POSITION 1.
    PARAMETERS: P_2 RADIOBUTTON GROUP R1.
    SELECTION-SCREEN END   OF LINE.
    Where the symbols text TEXT-001 and TEXT-002 have the label for the radiobuttons
    Max

  • Regarding use of radio button

    Dear All,
       I add two radio button in my form. And they work. One button for 'male' and another for 'female'.
    When i click male button then it sends '1' to database in the respective field and
    when i click female button then it sends '2' to database.
    But i need 'M' for male and 'F' for female.
    what is the solution.
    Good day.
                                                                                  Regards
                                                                 Bodhisatya Bhattacharjee

    Try something like this for the first Option button ...
            Dim oOptionBtn As SAPbouiCOM.OptionBtn
            With oItem
                .Left = 100
                .Top = 100
                .Width = 50
                .Height = 20
                oOptionBtn = .Specific
            End With
            With oOptionBtn ' data bind
                .Caption = strCaption
                .ValOn = 'M'
                .ValOff = 'F'
                If Len(strGroupWith) > 0 Then .GroupWith(strGroupWith) ' Use tihis to group the option buttons
                If Len(Trim(strFieldName)) > 0 Then .DataBind.SetBound(True, "", "FIELD1")
            End With
    and then set the
    ValOn = 'F'
    and .
    ValOff = 'M'
    for the other button.
    hope it works for you
    null

Maybe you are looking for