cancel
Showing results for 
Search instead for 
Did you mean: 

How to assign Radio Button group to a particular radio button.

Former Member
0 Kudos

Hi all,

I am new to ABAP Dynpro. I am working on object where two radio buttons needs to be clubbed in a radio button group by index. How do we assign a particular radio butto to a group? Can anyone help me with step by step code for the same requirement. Its urgent.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi darshna,

also check out this blog.

/people/thomas.szcs/blog/2006/07/24/basic-concepts--selection-vs-leadselection

cheers!

Ashish.

Former Member
0 Kudos

Hi Ashish,

Your answers are very helpful and it has solved my problem. We are trying this in our application. Thanks alot for your consideration. Do you have any Abap dynpro training material with practical examples. My e-mail id is darshna.thole@gmail.com. Thanks alot.

Cheers!

Darshna.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Darshna,

Since its Dropbyindex, you need to populate the node and the attribute with all tha values that u want to display in the context, before the view is rendered..

some pointers:

- use UI Element RadioButtonGroupByIndex and bind the texts property of this UI element with a particular Context Attribute.

- the node should not have a ddic type, but ya' the attribute can be from a particular table.

-now u should populate the node with the values that you want to diaplay.

some code snippet:

DATA:

lr_node TYPE REF TO if_wd_context_node,

lt_value_set TYPE wdy_key_value_table.

lr_node = wd_context->get_child_node(

name = if_componentcontroller=>wdctx_<your_node_name>).

- now fetch the data you want to display into an internal table(lt_value_set.). it should have 2 fields, one as value and the other as text.

You would see the text in the drop down and whichever text you select the corrosponding values would be stored in the context.

-Populate the node with the data.

CALL METHOD lr_node->bind_table

EXPORTING

new_items = lt_value_set.

************************************************************************************************

  • dynamically assigning values to the attributes meta data (Type). ie binding the values to a particular attribute.

************************************************************************************************

DATA: lr_node_info TYPE REF TO if_wd_context_node_info.

CALL METHOD lr_node->get_node_info

RECEIVING

node_info = lr_node_info.

CALL METHOD lr_node_info->set_attribute_value_set

EXPORTING

name = '<your_context_attribute>'

value_set = lt_value_set.

This code should be written in the wddoinit of the view controller or the component controller.

Hope this helps.

Cheers!

Ashish

Former Member
0 Kudos

Hi,

Need more info about this. Are you trying to do this dynamically???

Ashish

Former Member
0 Kudos

Hi,

Thanks for giving your time. Actually I am not doing it dynamically. My requirement is I have two radio buttons and I need to select one radio button and then click on one push button, so that it should take you to another page. Now at a time only one radio button should be pressed. Also by default one radio button should be pressed. I hope I am clear now. Kindly answer this que.asap. Thanks alot.