cancel
Showing results for 
Search instead for 
Did you mean: 

Radio Button Group By Index : i need 4 radio buttons

nandishm
Participant
0 Kudos

Hi..

I m new to web dynpro..

In Radio Button Group By Index, three button are coming, In my requirement i need 4 buttons... so any one can tell me how to make it

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

former_member184578
Active Contributor
0 Kudos

Hi,

By default it shows 3 radio buttons in group in the layout. But it actually depends on how many texts you have added and binded in WDDOINT method, it can be 1,4 5 or any.

Let say, you have created a node 'RADIO' with cardinality 0..n and an attribute (say value) in it.  And binded the texts property of radio button group to the attribute Value

Now write the below code in WDDOINT method:


   DATA lo_nd_radio TYPE REF TO if_wd_context_node.

     DATA lt_radio TYPE wd_this->elements_radio.

     DATA ls_radio TYPE wd_this->element_radio.

*   navigate from <CONTEXT> to <RADIO> via lead selection

     lo_nd_radio = wd_context->get_child_node( name = wd_this->wdctx_radio ).

* Fill Radio Button Texts

      ls_radio-value = 'Value1'.

      APPEND ls_radio TO lt_radio.

      ls_radio-value = 'Value2'.

      APPEND ls_radio TO lt_radio.

      ls_radio-value = 'Value3'.

      APPEND ls_radio TO lt_radio.

      ls_radio-value = 'Value4'.

      APPEND ls_radio TO lt_radio.

     lo_nd_radio->bind_table( new_items = lt_radio set_initial_elements = abap_true ).

Now you need to fill the lt_radio with the number of radio button you need as shown int he above code.

hope this helps

Regards,

Kiran

Answers (1)

Answers (1)

nandishm
Participant
0 Kudos

Thanks kiran

Its worked for me