Create radio button

Hai Experts,
                    How to create a simple radio button through UI , how to assign  values for the attributes selected key and key to select..explain in detail.
Thanks in advance,
Regards,
  R.Jude Silvester.

Hi Jude,
Basically you have 3 types of radio button objects:
1. Stand Alone radio button ( RadioButton)
2. Radion button group selected by index(RadioButtonGroupByIndex) - the most usefull one, I think
3. Radio button group selected by key ( RadioButtonGroupByKey) like RadioButtonGroupByIndex but index which is integer key is replaced by more general concept of key.
In order to use it you simply define radio button group(RadioButtonGroupByKey for example) then take context node and bind one of it's attributes to key and another one to value.Then you can use them.
For tutorial on how to use it please see help on:
SAP Web AS for Java Applications\Reference Manual\Standard Library of UI Elements\ RadioButtonGroupByIndex. It has the usage example inside it.
Hope it helps.
Regards.
Rajat

Similar Messages

  • What is the diffrence  between "Key to Select" and "Selected Key" while creating Radio  Buttons?

    While creating radio buttons there is a confusion regarding two properties "Key to Select" and "Selected Key".Can anybody explain it with example?
    Thanks,
    Vimal

    Hi Vimal,
    Please find my explanation as below
    Key to Select: This is the unique key for each radio button to identify which one is selected
    Selected Key: This holds the "KEY" of selected radio button
    Example:
       Let us say we have 2 radio buttons : Male & Female
         Create a context attribute SELECTED_KEY of type STRING.
         Create an action ON_SELECT for radio button select event
         Now,
         the properties for "MALE" radio button as below
              KEY_TO_SELECT = 'M'
              SELECTED_KEY = "bind to the context attribute SELECTED_KEY
              OnSelect = 'ON_SELECT'.
         The properties for 'Female" radio button as below
              KEY_TO_SELECT = 'F'
              SELECTED_KEY = "bind to the context attribute SELECTED_KEY
              OnSelect = 'ON_SELECT'.
    If we select radio button 'Male', we get the key as 'M' and for 'Female' radio button 'F'.
    check inside the event handler method ONACTIONON_SELECT, you get the 'KEY' of selected radio button.
    So, the context attribute 'SELECTED_KEY'  gets filled with the key of selected radio button
    Hope this helps you in distinguishing the 'KEY TO SELECT' & 'SELECTED KEY' .
    Regards,
    Rama

  • Create Radio button dynamically in Table column.

    HI All
       I have used following code to create radio button dynamically. but it's getting dump saying that Could not find attribute STATUS. 
    Here STATUS is the attribute of the node in View context. But why this dump is coming. 
    Please correct me if any thing worng.
      DATA: lr_radio TYPE REF TO cl_wd_radiobutton.
      DATA: lr_containr TYPE REF TO cl_wd_transparent_container.
      DATA: lr_data TYPE REF TO cl_wd_flow_data.
      IF first_time = abap_true.
        lr_containr ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
        lr_radio = cl_wd_radiobutton=>new_radiobutton(
        view = view
        id = 'RADIO'
        text = 'Enroll'
        bind_selected_key = 'STATUS'
        key_to_select = 'STATUS' ).
        lr_data = cl_wd_flow_data=>new_flow_data( element = lr_radio ).
        lr_radio->set_layout_data( lr_data ).
        lr_containr->add_child( lr_radio ).
      ENDIF.
    Thank you very much
    Ram

    Hi Rama,
    I solved it.check this code.
    i think u did mistake in creating radio button you are not passing the 
    BIND_KEY_TO_SELECT
      instead you are passing KEY_TO_SELECT.
    data:lr_column2 type ref to cl_wd_table_column,
         lr_radio type ref to cl_wd_radiobutton.
       lr_column2 = obj_table->get_column(
                   id         = 'TABLE1_PLANETYPE'
    *              INDEX      = INDEX
    lr_radio = cl_wd_radiobutton=>new_radiobutton(
    *      BIND_ENABLED        = BIND_ENABLED
           BIND_KEY_TO_SELECT  = 'STATUS'
    *      BIND_KEY_VISIBLE    = BIND_KEY_VISIBLE
    *      BIND_READ_ONLY      = BIND_READ_ONLY
           bind_selected_key   = 'STATUS'
    *      BIND_STATE          = BIND_STATE
    *      BIND_TEXT           = BIND_TEXT
    *      BIND_TEXT_DIRECTION = BIND_TEXT_DIRECTION
    *      BIND_TOOLTIP        = BIND_TOOLTIP
    *      BIND_VISIBLE        = BIND_VISIBLE
    *      ENABLED             = ABAP_TRUE
    *      EXPLANATION         = EXPLANATION
           ID                  = 'RAD1'
    *      KEY_TO_SELECT       = KEY_TO_SELECT
    *      KEY_VISIBLE         = KEY_VISIBLE
    *      ON_SELECT           = ON_SELECT
    *      READ_ONLY           = READ_ONLY
    *      STATE               = E_STATE-NORMAL
           TEXT                = 'Test'
    *      TEXT_DIRECTION      = E_TEXT_DIRECTION-INHERIT
    *      TOOLTIP             = TOOLTIP
    *      VIEW                = VIEW
    *      VISIBLE             = E_VISIBLE-VISIBLE
    lr_column2->set_table_cell_editor( the_table_cell_editor = lr_radio  ).
    Thanks,
    Suman

  • How to create radio button in module pool

    Hi All,
    Please tell me step by step procedure for creating radio button in module pool.give code for two radiobutton and at a time only one should be selected.
    Thanks
    Narendra

    Hi naren,
    In the layout of screen painter click on radiobutton option in the left icons and create in the layout and give name as Radio1 and again select the radiobutton icon and create another and give the name as radio2 and by dragging the cursor select the 2 radiobuttons and goto menubar->edit->grouping->radiobuttons grouping->define.
    Double clcik on the 2 radiobuttons and give FCT code for the coding purpose of the 2 radiobuttons.
    Cheers!!
    VEnk@

  • Creating radio buttons in XML Forms Builder

    Hi everyone,
    I can't seem to find any instructions on how to create Radio Buttons in XML Forms builder, anyone has a link or instruction on how to?
    Thanks,
    Samer

    Hi Samer,
    So taking the example for the slides, you need first to create a new child under DataModel for the DataSchema. You can name it "Gender".
    Click on the Radio Button in the Toolbar and drag "Gender" from the left hand site into the Edit Form.
    It should have already a first radio button and in the box on the bottum right you should see the reference in the Schema Reference field (/DataShema/DataModel/Gender).
    You can now drag a second button from the toolbar and place it behind the first one. Make sure you add the same value in the Schema Reference field.
    On the Show form or RenderListItem you need a Control Selector as mentioned on slide 18. You can just use right mouse click -> Add. Go on the new item on the right hand side, and click on "Add Multiple Labels". You can choose now how many radio buttons you have, here 2.
    In our example enter in one Label "Condition" = "true" and "Label" = "Male" and in the other "Condition" = "false" and "Label" = "Female".
    Finally, make sure that the Control Selector has the Schema Reference also as defined above (/DataShema/DataModel/Gender).
    Hope this helps,
    Robert

  • How to create radio button in reports

    Hi Friends,
    Can any body please tell how to create radio button in reports.
    Thanks,
    Nagendra

    Hi Nagendra,
        But why do u need a single radio button, any specific reason...
      try this
    REPORT  ZCHA1.
    PARAMETERS : P_RAD1 RADIOBUTTON GROUP RAD,
                 P_RAD2 RADIOBUTTON GROUP RAD.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF SCREEN-NAME = 'P_RAD2'.
          SCREEN-INVISIBLE = '1'.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.

  • Creating radio button and make it ennable

    Hello All ,
    Please help me out in creating radio button and make it ennable in web dynpro in java application .
    If Possible please send the sample code as well.
    Thanks
    jyothi.

    Hi Venkat,
    The default value needs to be set manually as John has suggested. To be more precise, if the context node is "RadioButtonValues" and the context attribute is 'RadioBtnVal', then in wdDoInit() method, include the following:
    wdContext.currentRadioButtonValuesElement.setRadioBtnVal("Male");
    Regards,
    Pavithra

  • How to create radio button between two slection screen

    hello all.
    could you please guide me how to create radio button between two SELECTION-SCREEN  in screen painter.
    Thank you,
    srinivas

    hi
    SEE THIS CODE
    REPORT  ZNNR_REPORT NO STANDARD PAGE HEADING MESSAGE-ID ZNNR LINE-SIZE 100 LINE-COUNT 65(4).
    ******DATA DECLARATIONS**********
    DATA : BEGIN OF IT_PLANT OCCURS 0,
            MATNR LIKE MARA-MATNR,
            WERKS LIKE MARC-WERKS,
            PSTAT LIKE MARC-PSTAT,
            EKGRP LIKE MARC-EKGRP,
           END OF IT_PLANT.
    DATA : BEGIN OF IT_PONO OCCURS 0,
            EBELN LIKE EKKO-EBELN,
            EBELP LIKE EKPO-EBELP,
            MATNR LIKE EKPO-MATNR,
            WERKS LIKE EKPO-WERKS,
            LGORT LIKE EKPO-LGORT,
           END OF IT_PONO.
    TABLES EKKO.
    ********END OF DATA DECLARATIONS*********
    ********SELECTION SCREEN DESIGN ***********
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETER : P_WERKS LIKE MARC-WERKS MODIF ID S1.
    SELECT-OPTIONS : S_EBELN FOR EKKO-EBELN NO INTERVALS MODIF ID S2.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : R3 RADIOBUTTON GROUP G2 DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 5(20) TEXT-003 FOR FIELD R3.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : R4 RADIOBUTTON GROUP G2.
    SELECTION-SCREEN COMMENT 5(20) TEXT-004 FOR FIELD R4.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-004.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : R1 RADIOBUTTON GROUP G1 DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 5(20) TEXT-002 FOR FIELD R1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS : R2 RADIOBUTTON GROUP G1.
    SELECTION-SCREEN COMMENT 5(20) TEXT-003 FOR FIELD R2.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK B2.
    ******END OF SELECTION SCREEN DESIGN****************
    <b>rEWARD IF USEFULL</b>

  • Creating radio buttons and text box in the screen

    Hi Guys,
    Need help asap. I am writing a report and I have to create text box for user to input GL account numbers for two types of customer. I have to make these fields required and take the data back from the screen and write it in a file. The second thing that I have to do is to make radio buttons for the user to select whether he wants the file written on the application server or the presentation server. and process the report accordingly. Now can somebody please given some code and tell me how I should do this. Both the things have to be done for the same report. Please help.
    Thanks,
    Minal

    Hi,
    TABLES: likp,
            lips.
    TYPES: Begin of ty_likp,
           vbeln like likp-vbeln,
         end of ty_likp.
    TYPES: Begin of ty_lips,
           vbeln like lips-vbeln,
           posnr like lips-posnr,
         end of ty_lips.
    DATA:  i_likp TYPE STANDARD TABLE OF ty_likp,
           i_lips TYPE STANDARD TABLE OF ty_lips,
           w_lips TYPE ty_lips,
           w_likp TYPE ty_likp.
    SELECTION-SCREEN BEGIN OF BLOCK b_0 WITH FRAME TITLE text-001.
    SELECT-OPTIONS:  s_delno FOR likp-vbeln,
                     s_type  FOR likp-lfart,
                     s_ship  FOR likp-vstel,
                     s_date  FOR likp-erdat.
    SELECTION-SCREEN END OF BLOCK b_0.
    SELECT vbeln
             FROM likp INTO TABLE i_likp
             WHERE vbeln IN s_delno
             AND   lfart IN s_type
             AND   vstel IN s_ship
             AND   erdat IN s_date.
      IF sy-subrc <> 0.
        MESSAGE i000 WITH text-002.
        " No valid deliveries for the selection parameters entered.
        STOP.
      ENDIF.
      IF NOT i_likp[] IS INITIAL.
        SELECT vbeln
               posnr
               FROM lips INTO TABLE i_lips
               FOR ALL ENTRIES IN i_likp
               WHERE vbeln = i_likp-vbeln.
      ENDIF.
    format color 1 on intensified on.
      WRITE: /01(46) 'Following are the Hanging Deliveries/Invoices:'.
    format color off intensified off.
    skip.
    format color 1 on.
      WRITE:  SY-ULINE(27).
      WRITE: /1       SY-VLINE,
              3(12)    'Document No.',
              16      SY-VLINE,
              17(8)  'Item No.',
              27      SY-VLINE.
    write:/1 sy-ULINE(27).
    format color off.
      sort i_lips by vbeln posnr.
      LOOP AT i_lips INTO w_lips.
          Read table i_likp into w_likp with key
                            vbeln = w_lips-vbeln
                            posnn = w_lips-posnr.
          if sy-subrc <> 0.
          format color 2 on.
             WRITE: /1   sy-vline,
                    3(12)  w_lips-vbeln,
                    16  sy-vline,
                    17(8)  w_lips-posnr,
                    27  sy-vline.
            write:/1 sy-uline(27).
            format color off.
            clear w_lips.
          endif.
          ENDLOOP.
    Try this one with ur own example.
    Thanks & Regards,
    Judith.

  • Creating Radio buttons in search

    Hi,
    My requirement is to have a radio group which will have two radio buttons; the user can select one of them.
    I created a view Accessor with the fixed values Y and N and attached this under one of my attribute;;
    This is displaying it on the search screen but not as a radio group. it displays as a drop down.
    Can anyone help me how can I achieve this.
    Thanks
    Anoop

    Hi Nitish,
    I have chosen as Radio Group only. But even it is displaying as drop down.
    I checked the blog http://dstas.blogspot.com/2012/03/adf-radio-group-inside-af-tree-table.html as well. This has the example of Tree table; I want to show the search criteria as radio group.
    Thanks
    Anoop

  • Creating radio buttons in table coloumn.

    Please share any documents available on how to
    create  and implement radio buttons in table coloumns .
    And please also share how to read the enabled or diaabled radio buttons

    Here is a guide to provide this feature:
    The context:
    - Persons (Node)
    -- Name (Attribute)
    -- SelectedKey (Attribute, String)
    -- Selection (Node, cardinality: 0..1, selection: 1..1, supplyFuntion selectPerson)
    --- KeyToSelect (Attribute, String)
    Layout:
    - Add table with dataSource propertie: Persons
    - Tablerow TextView with propertie text: Persons.Name
    - Tablerow RadioButton with propertie keyToSelect: Persons.Selection.KeyToSelect, selectedKey: Persons.SelectedKey, onSelect: SelectPerson
    Code:
    public void selectPerson(......) {
    ISelectionElement el = node.createSelectionElement();
    node.addElement(el);
    el.setKeyToSelect(parentElement.getName());
    public void onActionSelectPerson(.....) {
    for (int i=0; i < wdContext.nodePersons().size(); i++) {
    if (i != wdContext.nodePersons().getLeadSelection()) {
    wdContext.nodePersons().getElementAt(i).setAttributeValue("SelectedKey", null);
    Method above is for not getting a multiple select (work-around)
    If you have a button in your layout that submits the selection, you can read the selected row with:
    String key = wdContext.nodePersons().currentPersonsElement().getSelectedKey();
    wdComponentAPI.getMessageManager().reportSuccess(key);
    Regards,
    Björn
    Paresh,
    Does this guide solved your problem?
    Message was edited by: B. van Prooijen

  • Creating radio button

    Hi,
    I want to create radiobutton next to a radiobutton.I.e both are parallel to each other.How to create?

    Hi,
    You can just use the sample i sent before and create 7 more SELECTION-SCREEN BEGIN OF LINE  assigning 2 radio buttons in each.
    SELECTION-SCREEN BEGIN OF LINE .
    PARAMETERS : R1 RADIOBUTTON GROUP g1 DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 5(20) text-t01 FOR FIELD r1.
    SELECTION-SCREEN COMMENT 30(20) text-t02 FOR FIELD r2.
    PARAMETERS : R2 RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE .
    PARAMETERS : R3 RADIOBUTTON GROUP g1 DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 5(20) text-t01 FOR FIELD r13.
    SELECTION-SCREEN COMMENT 30(20) text-t02 FOR FIELD r4.
    PARAMETERS : R4 RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE .
    PARAMETERS : R5 RADIOBUTTON GROUP g1 DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 5(20) text-t01 FOR FIELD r5.
    SELECTION-SCREEN COMMENT 30(20) text-t02 FOR FIELD r6.
    PARAMETERS : R6 RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE .
    PARAMETERS : R7 RADIOBUTTON GROUP g1 DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 5(20) text-t01 FOR FIELD r7.
    SELECTION-SCREEN COMMENT 30(20) text-t02 FOR FIELD r8.
    PARAMETERS : R8 RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE .
    PARAMETERS : R9 RADIOBUTTON GROUP g1 DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 5(20) text-t01 FOR FIELD r9.
    SELECTION-SCREEN COMMENT 30(20) text-t02 FOR FIELD r10.
    PARAMETERS : R10  RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE .
    PARAMETERS : R11  RADIOBUTTON GROUP g1 DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 5(20) text-t01 FOR FIELD r11.
    SELECTION-SCREEN COMMENT 30(20) text-t02 FOR FIELD r12.
    PARAMETERS : R12 RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE .
    PARAMETERS : R13  RADIOBUTTON GROUP g1 DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 5(20) text-t01 FOR FIELD r13.
    SELECTION-SCREEN COMMENT 30(20) text-t02 FOR FIELD r14.
    PARAMETERS : R14 RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE .
    PARAMETERS : R15  RADIOBUTTON GROUP g1 DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 5(20) text-t01 FOR FIELD r15.
    SELECTION-SCREEN COMMENT 30(20) text-t02 FOR FIELD r16.
    PARAMETERS : R16 RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF LINE.
    Regards,
    Vik

  • Creating radio button in sourcing7

    Hi,
    Is it possible to create a radio button (not a check box) in SAP Sourcing7 as a field extension?
    If yes, how? If the datatype is selected as Boolean, the system by default creates a checkbox.
    Regards
    Moumita

    Hi Moumita,
    Radio button extension is currently not supported.
    Regards,
    Vikram

  • Creating Radio Button in Module Pool

    Hi All,
    I have created a Two radio button on screen 100.
    When I run this I will get both radio button selected.
    I am unable to group these.
    How can I group both?
    I am using 4.7. I am not getting Graphical Layout of the screen.
    How to group in classical only.

    Hi Praveen,
    Steps to group radiobuttons with alphanumeric editor.
    <li>Place the cursor on first radiobutton and click on Graphical element button in the application toolbar.
    <li>Now place the cursor on 2nd radiobutton and click on Define graph.group button in the application toolbar.
    <li>Now radiobuttons are grouped and first one is defaulted.
    Thanks
    Venkat.O

  • How do I create radio buttons which hide certain fields when selected?

    I have a set of two radio buttons, "Yes" and "No"
    When the "Yes" radio button is selected, I would like the "Bank Name", "Branch Number", "Institution Number" and the "Account Number" field to all be blocked from entering content into them.
    When the "No" button is selected, I would like for all of these fields to be available to be written in.
    I can do this currently with check boxes, but the problem with those is that both boxes can be checked at the same time, which is problematic.
    How can I make it so that the radio buttons control whether or not the fields can be written in!
    Thanks very much!

    Yes, I have done this. The buttons are mutually exclusive. The are in the group "Vendor EFT" - one is named "Yes", one is named "No".
    When the "Yes" radio button is selected, I would like the "Bank Name", "Branch Number", "Institution Number" and the "Account Number" field to all be blocked from entering content into them.
    When the "No" button is selected, I would like for all of these fields to be available to be written in.
    Not sure what code needs to be written for this.

Maybe you are looking for

  • Open Orders Cancellation & Sales Budget

    Hi Guru's, I have a scenario where in my client wants that all the open orders pending for processing after the month end should be cancelled in one go... Is this possible?.. Secondly is there any option in SAP to fix the Sales Budget for sales in a

  • Need a Big Help please on how to use getAppletContext() method

    I have three classes, first one extends JApplet, second class I use two create my popup menus, third class I use for my main actions to be done. I need when a popup menu is clicked to load a page, but I am getting this error. java.lang.NullPointerExc

  • Disable object, during busy cursor showing

    Hi guys, I've a complex text field which I can embed types of font within it. When I try to choose a specific font through the Dropdownlist, I'll show the busy cursor till font embeds inside the text field completely. I want to disable my text field

  • Light Ambient vs Directional

    Hi, does anyone has an idea why my geometry is not reflecting directional light . Yes, I did put the normals and the material. I clearly see that there is an effect with ambient light but not with directionnal. WHY, I"M BECOMING CRAZY! LV

  • How do you reinstall photshop? i tried everything, after i deleted it i don't know how to get it back

    i tried to get creative cloud but I'm signed in as my adobe user so i already got creative cloud on it, i can't get it again