cancel
Showing results for 
Search instead for 
Did you mean: 

create radio buttons at runtime

Former Member
0 Kudos

Hi all,

How do we create radio buttons at run time.

Thanks for the help.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks for the response.But i do not know the number of radio buttons needed at design time. Based on the values populated in the context at run time I need to generate the no of radio buttons at runtime. Ho w is this achieved.

Former Member
0 Kudos

If you do not want to create radio buttons dynamically.

Define them statically and you can hide them on some conditions in your code.

Regards,

Divya

abhimanyu_lagishetti7
Active Contributor
0 Kudos

In WDDOMODIFYVIEW put the code.

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 = 'radio button'

BIND_SELECTED_KEY = 'TEXT'

KEY_TO_SELECT = 'R1' ).

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.

Abhi