cancel
Showing results for 
Search instead for 
Did you mean: 

radiobutton group by index

arjun_thakur
Active Contributor
0 Kudos

hi experts,

i have a transparent container in which i have a radiobutton group by index UI element.

i have binded its text field with a string type attribute. i want a code with the help of which i can name those radio buttoms at runtime. eg: say for first radio button i want text as' employee' and for second i want text as 'office' and like that.

thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Arjun,

First Create the node with 0.n Cardinality and create String attribute for this node.

After that u can bind the Node's String attribute into text field of the Radiobutton group by index UI element. then U can write the following code in u r View Init Method WDDOINIT( ),

For Example :

Here Node name is radio_button , and Attribute name is name

DATA lo_nd_radio_button TYPE REF TO if_wd_context_node.

DATA lo_el_radio_button TYPE REF TO if_wd_context_element.

DATA ls_radio_button TYPE wd_this->element_radio_button.

DATA lt_radio_button TYPE wd_this->elements_radio_button.

  • navigate from <CONTEXT> to <RADIO_BUTTON> via lead selection

lo_nd_radio_button = wd_context->get_child_node( name = wd_this->wdctx_radio_button ).

  • get element via lead selection

lo_el_radio_button = lo_nd_radio_button->get_element( ).

ls_radio_button-name = 'Employee'.

append ls_radio_button to lt_radio_button.

ls_radio_button-name = 'Office'.

append ls_radio_button to lt_radio_button.

ls_radio_button-name = 'Manager'.

append ls_radio_button to lt_radio_button.

lo_nd_radio_button->bind_table( lt_radio_button ).

Regards,

Vijay