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

Similar Messages

  • Hi guys, This is very urgent, Creating radio button dynamically.

    Hi guys,
    I have this requirement where i need to access a table and depending on the possible answers for that question i need to display radio buttons on the next screen.
    lets say if i have the possible answers as YNX. i have to display three radio buttons besides the text one for YES, one for NO, one for N/A. I know this is kind of tricky but one more thing. if the possible answers are YN then i shud only have 2 radiobuttons one YES, one NO.
    and there are not only one text that im printing but there are multiple texts and radio buttons for each of them besides it.
    its urgent,
    Thanks

    Hi,
    here a short example:
    DATA: BEGIN OF SPOPLIST OCCURS 15.
            INCLUDE STRUCTURE SPOPLI.
    DATA: END   OF SPOPLIST.
    DATA: ANTWORT TYPE C.
    DATA: VALUE(3).
    VALUE = 'YNX'.
    SPOPLIST-VAROPTION = 'Yes'.
    APPEND SPOPLIST.
    SPOPLIST-VAROPTION = 'No'.
    APPEND SPOPLIST.
    IF VALUE = 'YNX'.
      SPOPLIST-VAROPTION = 'N/A'.
      APPEND SPOPLIST.
    ENDIF.
    CALL FUNCTION 'POPUP_TO_DECIDE_LIST'
      EXPORTING
        TITEL            = 'Set your Answer'
        TEXTLINE1        = 'Please select'
        TEXTLINE2        = 'You can chosse this'
        TEXTLINE3        = 'Options'
      IMPORTING
        ANSWER           = ANTWORT
      TABLES
        T_SPOPLI         = SPOPLIST
      EXCEPTIONS
        TOO_MUCH_ANSWERS = 1
        TOO_MUCH_MARKS   = 2.
    IF ANTWORT = 'A'.
      WRITE: 'Popup canceled.'.
    ELSE.
      WRITE: 'This is select:'.
      LOOP AT SPOPLIST WHERE SELFLAG = 'X'.
        WRITE: SPOPLIST-VAROPTION.
      ENDLOOP.
    ENDIF.
    in the Docu of the FM there is another example with checkboxes.
    Hope it helps.
    Regards, Dieter

  • Creating a radio button group in a column of a table in Web Dynpro

    Hi,
    I want to put a radio button group in a column of a table in Webdynpro. I added a column to a web dynpro view and then inserted a tableCellEditor for that column.. But I cannot define it as Radio Button group. I want the user to be able to select 3 statuses using this group.
    Does anyone have a solution for this??
    Thanks in advance...
    Nakul

    Hi,
    You wont be able create three RB in one cell.
    Create as many column as the no of options is.Here it is 3.
    Create 4 attributes inside the node , option 1,option 2,option 3 and selectedoption.
    Map each RB s keytoSelect to option 1,2,3. Map all the RBs selectedKey atribute to selectedoption.
    Now selection for each row will be stored in the selected option.
    Regards
    Bharathwaj

  • Radio Button in a table

    Hi ,
    My requirement is to have a radio button in a table .
    scenerio : i have 3 coloumns in a table as shown below
    From Date      To Date            Select
    Select coloumn is a radio button . i made that coloumn to a radio button in table not in SALV .
    Now , data will be fetched from the DB for first two coloumns and where the difference of FROMDATE AND TODATE will be greater or equal to 5 only those rows should have a active radio button which can be clicked .
    Other rows should have disabled radio button.
    Moreover , User can select only one radio button at a time .
    if it can be possible with SALV , suggest me that option as well.
    Thanks.

    Hello,
    find the steps to achieve your requirement with normal table UI element. I'm not sure whether the same will work for alv. I expect it to work
    1. Create one boolean attribute in the Table Context node to indicate whether the radio button should be enabled or not (Attribute name : say RB_ENABLED). Populate the value of this attribute based on your From_Date DIF TO_DATE >= 5.
    2. Create a string attribute in the table context node to indicate the value for the radio button (Attribute Name: say RB_VALUE)
    Populate the Value of this attribute like for first record say FIRST and second record say SECOND. Or if you have unique Id for each row then you populate the same here.
    This attribute is required to identiy which radio button is selected by the user
    3. Create a context node (say RB_SELECTED) of cardinality 1..1 and an attribute of type string (say RB_SELECTED)
    4. In the table ui element, create a Radio button column and bind the following
    enabled property to RB_ENABLED attribute
    KeyToSElect to RB_VALUE attribute
    SElectedKEy to RB_SELECTED.
    So at runtime whenever the user selects a radio button, the correpsonding value will be set in the RB_SELECTED attribute. example if the user selects the radio button in the first row, the value 'FIRST' will be populated in the RB_SELECTED attribute.
    BR, Saravanan

  • Radio button dynamic events

    Hai,
    I am using two radio buttons above the table. If i click first radio button table below should show the fields with some colyumn in drop down option. if i select other one it should show the table cell with editable options(instead of drop down). any ideas pls

    Hi Uday/Rupa,
    i did the similar scenario and i got the output.I didnt give complete logic in my previous post that was outline logic.
    If you change the celleditor dynamically you can accomplish this.
    I have taken this scenario.I have one check box and one table in my view.When check box is not selected i am showing radio buttons in the column of table.
    when i select the check box i am showing the column data in editable mode.
    Write the below code in WDDOMODIFYVIEW
    obj_table ?= view->get_element( 'TABLE1' ).
    data: lr_event type ref to cl_wd_custom_event,
          lr_radio type ref to CL_WD_RADIOBUTTON.
    i am calling this event handler method and i am initializing the value CHECK_VAL which i declared in the attributes of view.     
      *wd_this->onactioncheck(*
        *wdevent = lr_event          " Ref to cl_Wd_Custom_Event*
    if wd_this->check_val is not initial.
    lr_column = obj_table->get_column(
                   id         = 'TABLE1_PRICE'
    *              INDEX      = INDEX
    lr_input = cl_wd_input_field=>new_input_field(
          bind_value          = 'FLIGHTS.PRICE'
          id                  = 'IP1'
    lr_input->set_read_only( value = abap_false   ).
    lr_column->set_table_cell_editor( the_table_cell_editor = lr_input  ).
    else.
    lr_column = obj_table->get_column(
                   id         = 'TABLE1_PRICE'
    *              INDEX      = INDEX
       lr_radio =   cl_wd_radiobutton=>new_radiobutton(
    *              BIND_ENABLED        = BIND_ENABLED
    *              BIND_KEY_TO_SELECT  = BIND_KEY_TO_SELECT
    *              BIND_KEY_VISIBLE    = BIND_KEY_VISIBLE
    *              BIND_READ_ONLY      = BIND_READ_ONLY
                  bind_selected_key   =  'RAD1'
    *              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                  = 'RD1'
    *              KEY_TO_SELECT       = KEY_TO_SELECT
    *              KEY_VISIBLE         = KEY_VISIBLE
    *              ON_SELECT           = ON_SELECT
    *              READ_ONLY           = READ_ONLY
    *              STATE               = E_STATE-NORMAL
                   TEXT                = 'Radio'
    *              TEXT_DIRECTION      = E_TEXT_DIRECTION-INHERIT
    *              TOOLTIP             = TOOLTIP
    *              VIEW                = VIEW
                  VISIBLE             = '02'
    lr_column->set_table_cell_editor( the_table_cell_editor = lr_radio  ).                 
    endif.
    See the output.
    I am unable to paste my output images here using picasa.
    Thanks
    Suman.

  • Radio button in a Table -Only one row/radio button selection to be possible

    Hi experts,
    I have a requirement from customer to have a radio button inside a table of a WebDynpro ABAP application. For example, a table containing list of mobile numbers.
    The columns has
    Mobile Model, Cost, Company name, and a radio button named choice.
    Only one record and hence one radio button can be chosen at a given time.
    When the user clicks on the radio button choice corresponding to the row of the mobile of his choice, the row should get lead selected .
    When the user chooses a different choice radio button (corresponding to another mobile) the old radio button choice should get deselected, new row and its radio button should be lead selected.
    Can you give me the code how to deselect the remaining radio buttons when a user selects on one Radio button

    Hi Sandeep ,
    Have a look at the events of table UI element and its paramaters , Here's the link.
    [Link|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/2d/390e422dfcde2ce10000000a1550b0/content.htm]
    The event 'Onselect' or 'OnLeadSelect' provides 4 standard paramaters , out of which , OLD_LEAD_SELECTION/OLD_ROW_ELEMENT is one of them.
    So you could use this element and set the attribute value (Which is bound to the radio button) to abap_false.
    Although I am not sure as to which event ight trigger ( ON_LEAD_SELECT / ON_SELECT ).:)
    Thanks,
    Aditya.

  • 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>

  • 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

  • Calling a method in a bean when i clcked on the radio button of a table

    Hi,
    I need to call a method in the bean when i clicked on the radio button of a table
    I tried it , by callling the method in selectionListener..
    I can able to execute only System.out.prinln method,
    rather than that i am unable to execute any other expression..
    like setting rendering property to a component.
    Thanks in advance,

    Hi,
    what you say is not true. You can execute any code within a selection listener you want. If you can print then it shows the method s called and you can execute whatever you want within this method
    Frank

  • How to disable the inputfield using radio button dynamically in module pool

    How to disable the inputfield on the screen using radio button dynamically in module pool.
    Please suggest .
            Thanks.
    Edited by: Lavanya YH1504 on Jul 30, 2010 1:20 PM

    I got it thank you.
    LOOP AT SCREEN.
        if  screen-GROUP1 = 'LA1'.
           If RADIO1 = 'X'.
            SCREEN-INPUT = '0'.
            MODIFY SCREEN.
         ELSEIF RADIO2 = 'X'.
           screen-input = '1'.
          ENDIF.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    Edited by: Lavanya YH1504 on Jul 30, 2010 1:51 PM

  • How can I add radio buttons dynamically?

    Hi,
    I need to add radio buttons dynamically. I will be having a set of options which will be coming form a web service call and I need to convert those options into radio buttons and show it to the user. How can I do it?
    Thanks,
    Hali George

    Yep .... I too would  rather have seen more time put into that kind of stuff than parallax scrolling.

  • 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

Maybe you are looking for