Dynamic radio button in web dynpro abao

Hi expert,
I want to dynamic radio button by  web dynpro abap .
Kindly give me a soulation ASAP.
Thanks and regard's
Vikash

hi,
method wddomodifyview .
if first_time eq abap_true.
data: LR_CONTAINER         type ref to CL_WD_UIELEMENT_CONTAINER,
      LR_RADIOBUTTON1            type ref to CL_WD_RADIOBUTTON,
      LR_RADIOBUTTON2            type ref to CL_WD_RADIOBUTTON,     
      LR_FLOW_DATA         type ref to CL_WD_FLOW_DATA.
" bind text property will give TEXT that appears next to Radio Button
CALL METHOD cl_wd_radiobutton=>new_radiobutton
  EXPORTING
   bind_selected_key   =  '01' 
   BIND_TEXT           =  'saurav'
  receiving
    control             = LR_RADIOBUTTON1.
" bind text property will give TEXT that appears next to Radio Button
CALL METHOD cl_wd_radiobutton=>new_radiobutton
  EXPORTING
    bind_selected_key   = '02'
   BIND_TEXT           = 'mago'
  receiving
    control             = LR_RADIOBUTTON2.
LR_FLOW_DATA        =  CL_WD_FLOW_DATA=>NEW_FLOW_DATA( element = LR_RADIOBUTTON1  ).
LR_FLOW_DATA        =  CL_WD_FLOW_DATA=>NEW_FLOW_DATA( element = LR_RADIOBUTTON2  ).
LR_CONTAINER ?= view->GET_ELEMENT( 'ROOTUIELEMENTCONTAINER' ).
LR_CONTAINER->ADD_CHILD( LR_RADIOBUTTON1  ).
LR_CONTAINER->ADD_CHILD( LR_RADIOBUTTON2  ).
endif.
endmethod.
Thanx.

Similar Messages

  • Help needed in Radio buttons (ABAP web dynpro)

    Hi all,
    I need to implement 2 stand alone Radio buttons (not groupbykey or groupbyindex). I could add the same in my view layout, but I am not sure how to use the KeyToSelect and SelectedKey options. How do I control when the button is selected/deselected and how do I obtain this information from my context?
    Thanks in advance guys!
    -Shalini.

    hi shalini....
    create two attributes of type string for the two rado buttons and give two different default values for that. say a and b...
    bind the attribute to the property selected key...
    give the default value as the key to select in the property....
    or you can bind the same attribute to both the buttons and read the attribute to check which value has been selected...
    you can also go through wdr_test_events component.
    ---regards,
       alex b justin

  • Position  for dynamic radio button

    Hi expert,
    i created a dynamic radio button in my web dynpro application but i want to give the position in top of the my view kindly give me on example for this issue.
    thank's and regard's
    vikash

    Use this.............
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/201ddd3b-b4ce-2b10-8883-880ae8147f89
    The sequence to place a new UIElement at the screen is as follows:
    1.Create the UIElement
    2.Create the LayoutData that fits to the Layout of the surrounding container
    3.Insert the UIElement into the surrounding container
    *Code to create new button dynammically:
    lr_button = cl_wd_button=>new_button( on_action = `CHANGE_TEXT` ).
    **The following coding changes the design of a button to "emphasized":*
    lr_button->set_design( cl_wd_button=>e_design-emphasized ).
    set the new text*
      lr_button->set_text( new_text ).
    For Step 2 and Step 3 refer code by Radhika.
    Thanx.
    Saurav.

  • Detail Button in Web Dynpro ALV

    Hi at all,
    when I create an ALV in Standard ABAP there is a small "Detail" button on the left side of the button row without any additional complex programming.
    How can I get this button in Web Dynpro ALV?
    Dirk

    The standard ALV Component in Web Dynpro doesn't have this features.  It wouldn't be too difficult to add manually.  You could simply bind a custom view to the lead selection of the same context you are using in the ALV and use the form wizard to generate the UI elements.  It isn't quite as nice becuase it woudl require a few manual steps for each usage of the ALV where you want this functionality.

  • Dynamic radio button and group

    Hi, we have create dynamic radio button and group on “application creation complete” event , but which I am try to get number of radio button its show zero, see below code
    import flash.utils.setTimeout;
    import mx.controls.Alert;
    import mx.events.FlexEvent;
    import spark.components.RadioButton;
    import spark.components.RadioButtonGroup;
    private var  rbg:RadioButtonGroup;
    private var  rb1:RadioButton;
    private var  rb2:RadioButton;
    private var dcount:int = 0;
    protected function application1_creationCompleteHandler(event:FlexEvent):void
         // TODO Auto-generated method stub
         // TODO Auto-generated method stub
         rb1 = new RadioButton();
         rb2 = new RadioButton();
         rbg = new RadioButtonGroup();
         rb1.label = "Radio1";
         rb2.label = "Radio2";
         rb1.group = rbg;
         rb2.group = rbg;
         vbox1.addChild(rb1);
         vbox1.addChild(rb2);
         checkRadioButton (); 
    protected function checkRadioButton ():void
         Alert.show("In checkRadioButton function : " +  rb1.group.numRadioButtons.toString());
    If I put some Time interval to call  checkRadioButton function its working fine,
    //checkRadioButton (); 
    setTimeout(checkRadioButton,1000);
    but this is not best practice.
    why this happen ….can anybody  clear  this or any other way to do this.
    Thanks in advance

    @manjeet.patel,
    Just write the below line of code
    vbox1.validateNow();
    You need not use setTimeout() function
    vbox1.addChild(rb1);
    vbox1.addChild(rb2);
    vbox1.validateNow();
    Thanks,
    Bhasker

  • Submit Button In Web Dynpro Layout not working.

    Hi All,
             I have integrated an adobe form in my web dynpro application.According to my requirement the view of screen should change when the user clicks on submit button.So I have given the submit button as one of the UI element in my WD object along with the form.But when I click on the submit button the functionality doesnot work.
    The same submit button works when there is no adobe form integrated in my WD application.
    Please let me know what needs tyo be done so make that submit button work.
    Thanks and Regards,
    Sarang

    Sarang,
    Lets go step-by-step.
    1. Create two views in your applications lets say the names are View1 and View2.
    2. Goto Diagram View of the Window in under Windows node in your Web Dynpro Explorer in NWDS.
    3. Create Inbound and Outbound plugs for View1 namely inbView1 and outView1
    4. Repeat the same for View2. So names will be inbView2 and outView2.
    5. Create a navigational link between the Vies by creating a link from outView1 plug to inView2 plug.
    6. Goto Layout tab for the View1. This is where you have embedded the Interactive form element.
    7. Set the displayType property to native.
    8. Under Events there will be onSubmit method, craete a new method called navigateToView2 and click Go. This will take you where you can implement your logic.
    9. Fire the outbound plug of View1. See following code snippet:-
    public void onActiong navigateToView2(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActiongotoView2(ServerEvent)
        wdThis.wdFirePlugOutView1();
        //@@end
    10. Edit the Interactive form, it should open Adove LiveCycle Designer.
    11. Drag-drop Submit button from WD Native library ontot the form.
    11. Don't modify anything and check if you see below code snippet in the Editor.
    // DO NOT MODIFY THE CODE BEYOND THIS POINT - 705.20051114114126.253659.250577 - SubmitToSAP.xfo
                          ContainerFoundation_JS.SendMessageToContainer(event.target, "submit", "", "", "", "");
                          // END OF DO NOT MODIFY
    12. Now whenever you click submit button on the form, what it does is that it makes call to WD framework and the onSubmit action handler is called where you have written the code to navigate to View2.
    Chintan

  • Calling a smart form on click of a button in web dynpro abap

    Hi experts,
    I have a requirement like if I click a button in a view i need ti generate a PDF through smart form.
    Is this possible. If so please tell me the way..
    Thanks & Regards

    Hi Sharma,
    Create Interactive form in your view, create one node say PDF_SOURCE under this one attribute PDF_SOURCE of type XSTRING.
    Bind this to IF form Datasource and pdfsource.
    in your button action write code to call your smartform
    using SSF_FUNCTION_MODULE_NAME
    using FM  CONVERT_OTF and attach_file_to_response
    *convert to pdf
      call function 'CONVERT_OTF'
        EXPORTING
          format                = 'PDF'
        IMPORTING
          bin_filesize          = lv_bytecount
        TABLES
          otf                   = ls_job_output_info-otfdata
          lines                 = lt_lines
        EXCEPTIONS
          err_conv_not_possible = 1
          err_bad_otf           = 2.
      loop at lt_lines into ls_line.
        lv_string = ls_line.
        export mydata = lv_string to data buffer lv_buffer.
        import mydata to l_xline from data buffer lv_buffer in char-to-hex
        mode.
        concatenate l_pdfstring l_xline into l_pdfstring in byte mode.
      endloop.
      call method cl_wd_runtime_services=>attach_file_to_response
        EXPORTING
          i_filename      = 'ZWTY_PACKINGSLIP'
          i_content       = l_pdfstring
          i_mime_type     = 'BIN'
          i_in_new_window = abap_false
          i_inplace       = abap_false.
    also check this..
    http://abapcodexperiments.wordpress.com/2011/03/20/smartform-pdf-webdynpro-abap/
    Call smartform in web dynpro abap
    Cheers,
    Kris.

  • Calling URL when click on buttons using web dynpro - ABAP

    Hi All,
    I am new to web dynpro application development and i am facing issue when i try to test my application.
    simple require when i click on button i should direct the to one of url say 'http://www.google.co.in/' my application is activate with no error but when i test the application i am getting below error , can someone please provide me the solution or way out.
    The URL http://ides47:8062/sap/bc/webdynpro/sap/zwa_calling_url/ was not called due to an error.
    Note
    The following error text was processed in the system N6Q : Access via 'NULL' object reference not possible.
    The error occurred on the application server IDES47_N6Q_62 and in the work process 0 .
    The termination type was: RABAX_STATE
    The ABAP call stack was:
    Method: IF_WDR_CONTEXT_MENU_HANDLER~CONTEXT_MENU_CALLED of program CL_WDR_INTERNAL_WINDOW_ADAPTERCP
    Method: IF_WDR_CONTEXT_MENU_HANDLER~CONTEXT_MENU_CALLED of program CL_WDR_INTERNAL_WINDOW_ADAPTERCP
    Method: IF_WDR_ADAPTER_EVENT_HANDLER~HANDLE_EVENT of program CL_WDR_CONTEXT_MENU_HANDLER===CP
    Method: IF_WDR_CLIENT~GET_CLIENT_UPDATES of program CL_WDR_CLIENT_SSR=============CP
    Method: EXECUTE of program CL_WDR_MAIN_TASK==============CP
    Method: IF_HTTP_EXTENSION~HANDLE_REQUEST of program CL_WDR_MAIN_TASK==============CP
    Method: EXECUTE_REQUEST_FROM_MEMORY of program CL_HTTP_SERVER================CP
    Function: HTTP_DISPATCH_REQUEST of program SAPLHTTP_RUNTIME
    Module: %_HTTP_START of program SAPMHTTP
    HTTP 500 - Internal Server Error
    Thanks,
    Parab

    Hi ,
    It seesms something you are missing. It would be easy for us if you could paste your code which you have written in the Action of Button.
    Sample code for your reference :
    METHOD onactionget_url .
    data lo_window_manager type ref to if_wd_window_manager.
    data lo_api_component  type ref to if_wd_component.
    data lo_window         type ref to if_wd_window.
    lo_api_component  = wd_comp_controller->wd_get_api( ).
    lo_window_manager = lo_api_component->get_window_manager( ).
    CALL METHOD lo_window_manager->CREATE_EXTERNAL_WINDOW
      EXPORTING
        URL            = 'http://www.google.co.in/'
        MODAL          = ABAP_FALSE
        HAS_MENUBAR    = ABAP_TRUE
        IS_RESIZABLE   = ABAP_TRUE
        HAS_SCROLLBARS = ABAP_TRUE
        HAS_STATUSBAR  = ABAP_TRUE
        HAS_TOOLBAR    = ABAP_TRUE
        HAS_LOCATION   = ABAP_TRUE
      RECEIVING
        WINDOW         = lo_window.lo_window->open( ).
    ENDMETHOD.

  • Print Button in Web Dynpro ABAP

    Hi Everybody,
    i hope that someone know or have a code sample how i can set a print button to the Web Dynpro for ABAP. On click on this it should open the print window from the Internet Explorer.
    Please let me know if there is any information about this.
    Thanks
    Best regards
    Markus

    Hi,
    If you are using the Internet Explorer 7, you can use CTRL + P to invoke print directly on any WebDynpro ABAP view.  This is IE 7.0 browser featute & always has print preview & print options available from File Menu's. So you dont require any additional buttons on view :).
    For table data if you use ALV you get options to export data to excel or fire print directly
    Greetings
    Prashant

  • Dynamic radio button fields do not display again after form is saved

    Hello,
    I have a group of radio button questions within a dynamic form that display additional questions based on the answer.
    So for the question "Is there a basement?" if the user indicates yes, there is a basement, additional questions are displayed to gather more information about the basement. If the user indicates no, then those questions do not appear.
    Everything works beautifully in the form. However, when the form is saved and then re-opened, the additional questions do not appear in the form. So the structure goes from this:
    To this:
    The users must toggle the radio buttons to make those questions reappear...and when they do reappear, they have maintained whatever answer the user indicated before saving.
    I'm not sure why this is happening...does anyone have any advice?
    Thank you,
    Theresa

    Hi,
    Thanks so much for your response! I am using Designer 8.2.1.
    I just played around with more of my form...this seems to happen whenever I am working with a hidden subform that is displayed when the user clicks a button (or selects the appropriate radio button). I have a couple of other places within my form where this occurs.
    Here is an example of the script on one of those buttons:
    var intNewIndex = form1.construction_type.const_type_repeat.instanceManager.count-1; 
    form1.construction_type.resolveNode("const_type_repeat[" + intNewIndex + "]").percentage.presence="visible";
    const_type_repeat.instanceManager.addInstance(true);
    The script on the radio button is:
    if (basementyes.rawValue == 4){secondwd.sump.presence ="visible"
      secondwd.sumpradio.sumpyes.presence ="visible"
      secondwd.sumpradio.sumpno.presence ="visible"
    else {secondwd.sump.presence = "hidden"
      secondwd.sumpradio.sumpyes.presence = "hidden"
      secondwd.sumpradio.sumpno.presence ="hidden"
    I am pretty new at this so it might be something obvious...thanks again for your help!

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

  • How to put dynamic search help in web dynpro ABAP.

    Hi,
    I have a table element with two columns in my web dynpro ABAP.Both the columns are F4 helps.
    Based on the value of the first column,the F4 help of second column must change dynamically.Kindly tell me how to do this.
    Thanks & Regards,
    Raji.

    Hi ,
    Use this code to dynamically assign search help and to deactivate search helps.
    data lo_nd_info type if_wd_context_node_info.
    lo_nd_info = lo_nd->get_node_info( ).
    CALL METHOD lo_nd_info->set_attribute_value_help
    EXPORTING
    name = 'ATTR1' " Your attribute Name
    value_help_mode = '121' " Valid value help mode
    value_help = 'Z187442'. " Search help name
    The various possible values that you can pass to value_help_mode are as shown below.
    deactivated 101
    automatic 111
    ddic 121
    ovs 131

  • Submit button in Web Dynpro Native and ActiveX tab

    We use LiveCycle Designer 7.1 in a SAP environment (CRM5.0/NW2004S 7.0.06). We are creating an online Interactive Form via Web Dynpro for Java using NW2004S.
    In NW2004 you have to possibility to select the 'Submit to SAP' button from the Web Dynpro tab. However, in NW2004S this has been changed into 2 submit buttons, one on Web Dynpro Native and one on Web Dynpro ActiveX tab. Does somebody know what the differences are compared to NW2004? When to choose what button and what kind of code you need to enter to send the data the SAP?
    kind regards
    Angelique Heutinck

    Sarang,
    Lets go step-by-step.
    1. Create two views in your applications lets say the names are View1 and View2.
    2. Goto Diagram View of the Window in under Windows node in your Web Dynpro Explorer in NWDS.
    3. Create Inbound and Outbound plugs for View1 namely inbView1 and outView1
    4. Repeat the same for View2. So names will be inbView2 and outView2.
    5. Create a navigational link between the Vies by creating a link from outView1 plug to inView2 plug.
    6. Goto Layout tab for the View1. This is where you have embedded the Interactive form element.
    7. Set the displayType property to native.
    8. Under Events there will be onSubmit method, craete a new method called navigateToView2 and click Go. This will take you where you can implement your logic.
    9. Fire the outbound plug of View1. See following code snippet:-
    public void onActiong navigateToView2(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActiongotoView2(ServerEvent)
        wdThis.wdFirePlugOutView1();
        //@@end
    10. Edit the Interactive form, it should open Adove LiveCycle Designer.
    11. Drag-drop Submit button from WD Native library ontot the form.
    11. Don't modify anything and check if you see below code snippet in the Editor.
    // DO NOT MODIFY THE CODE BEYOND THIS POINT - 705.20051114114126.253659.250577 - SubmitToSAP.xfo
                          ContainerFoundation_JS.SendMessageToContainer(event.target, "submit", "", "", "", "");
                          // END OF DO NOT MODIFY
    12. Now whenever you click submit button on the form, what it does is that it makes call to WD framework and the onSubmit action handler is called where you have written the code to navigate to View2.
    Chintan

  • Close OVS Help via Button in Web Dynpro for ABAP

    Hello!
    Is it possible to use a close-button in a "ovs help popup"? I tried to fire a "Type-Exit Outbound-Plug" of window controller of the "ovs help window" but it didn't work.
    Thanks for help
    Joerg

    Hello Joerg,
    in Web Dynpro for ABAP there is currently no possibility to subscribe to the close event of the OVS popup.
    Regards, Ariane.

  • Dynamic table columns in web dynpro abap

    Hi,
    In my current project I have got a requirement whose solution I am not able to figure out.
    My requirement is this:
    I will have a table containig budget owners name(since its compensation management in HR).There will be a table popin inside this table on the click of the personal number of the budget owner. Now the table popin will have another table with all employees name under that particular budget owner.
    The problem is that the table inside the popin will not be having fixed columns.Actually the columns will be coming from a standard java web dynpro application (say in the form of an internal table).
    My requirement is this how can this be handled?Can we include all the possible columns in the node(which i bind to the child table) and make them visible/invisible during runtime? or create a dynamic node and assign it to the table(but in this case a node needs to be bound to the table during design time,what to bind?)  ?
    Can u please help along with code snippets.
    Thanks and Regards,
    Saikat.

    Thnx for the input.
    I am abke to make the table columns inside the popin visible/invisible.
    I have a tabstrip.Indise one of the tabs is my main table and inside one of the columns is the popin.Inside that a transparent container and finally the table inside that.
    This is the code that worked for me.
    METHOD wddomodifyview .
      DATA lr_root_container TYPE REF TO cl_wd_uielement_container.
      DATA lr_table_popin TYPE REF TO cl_wd_table_popin.
      DATA lr_transparent_container TYPE REF TO cl_wd_transparent_container.
      DATA lr_table TYPE REF TO cl_wd_table.
      DATA lr_table_column TYPE REF TO cl_wd_table_column.
      DATA lr_table_in_table_popin TYPE REF TO cl_wd_table.
      DATA lr_node_header_node TYPE REF TO if_wd_context_node.
      DATA lr_node_item_node TYPE REF TO if_wd_context_node.
      DATA lr_tabstrip TYPE REF TO cl_wd_tabstrip.
      DATA lr_tab TYPE REF TO cl_wd_tab.
      data lr_tc type ref to CL_WD_TRANSPARENT_CONTAINER.
      data lr_table2 type ref to cl_wd_table.
      DATA lr_table2_column TYPE REF TO cl_wd_table_column.
      IF first_time = abap_false.
        lr_root_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
        lr_tabstrip ?= lr_root_container->get_child( id = 'TABSTRIP1' ).        "GETTING THE TABSTRIP
        lr_tab      ?= lr_tabstrip->get_tab( id = 'TAB1' ).        "GETTING THE TAB INSIDE TABSTRIP
        lr_table    ?= lr_tab->GET_CONTENT( ).      "GETTING THE CONTENT(TABLE IN THIS CASE) INSIDE TABSTRIP
        lr_table_column ?= lr_table->get_grouped_column( id = 'TABLE_MAIN_PERNR' ).   "GETTING THE COLUMN INSIDE THE TABLE
        "Table popin
        lr_table_popin ?=  lr_table_column->GET_POPIN( ).   "GETTING THE POPIN INSIDE THE TABLE
        lr_tc  ?= lr_table_popin->GET_CONTENT( ).   "GETTING THE CONTENT(TRANSPARENT CONTAINER IN THIS CASE)INSIDE THE TABLE
        lr_table2 ?= lr_tc->get_child( id = 'TABLE_EMPLOYEE' ).        "GETTING THE EMPLOYEE TABLE INSIDE THE TRANSPARENT CONTAINER
        lr_table2_column ?= lr_table2->get_grouped_column( id = 'TABLE_EMPLOYEE_PERNR' ).   "GETTING THE COLUMN INSIDE THE TABLE
        lr_table2_column->SET_VISIBLE( '02' ).  "SETTING VISIBILITY FOR THE COLUMN
      ENDIF.
    ENDMETHOD.
    But I'm still considering the dynamic node concept.Lets see if this works out or not.If not then I'll have to go for the dynamic node thing.
    Thanks,
    Saikat

Maybe you are looking for

  • Macbook Pro AHT Failure (graphics chip)

    Im a bit confused. I ran the Apple hardware test on my 15" macbook pro (10 months old) before taking it if for repair as the superdrive was failing (not from over use). I was surprised to see that it had failed with 4VDC/1/40000003: VideoController a

  • Error message when installing flash update 01/14

    See discussion title above...

  • !!!URGENT!!!!  -- Output Changes supplier details in an XML format

    Hi all, My platform is 11i Apps and 8i Database I am really new to XML, however I have a requirment to achieve the following: For updated or new suppliers, I need to output the new information in an XML format. But, I am not sure how best to achieve

  • HP TouchPad - Battery with question mark.

    HP TouchPad (16GB) WebOS/Cyanogen Mod daul boot.  When I turn on the TouchPad it boots to a screen with a white edged battery with a question mark in the middle.  When the charger is plugged in the home button or center button on the TouchPad lights

  • SONY PVM 14L4 not recognised via firewire

    Hi to all, I've rented a sony PVM 14L4 monitor for color correction that i'm trying to hook up to my dual G4 via firewire. FCP 5 doesn't seem to recognise it. I don't have the manual and am wondering if it is possible to hook it up directly through o