cancel
Showing results for 
Search instead for 
Did you mean: 

Setting lead selection

Former Member
0 Kudos

Hi all,

I am having a radio button in my table. On click of that radio button the corresponding row of the table should be selected. Can anybody help me to do it.

Thanks,

Mugundhan

Accepted Solutions (1)

Accepted Solutions (1)

arjun_thakur
Active Contributor
0 Kudos

Hi Kandha,

Use the following code:


data: lr_element type ref to if_wd_context_element,
          lv_index type i.
 
  lr_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT'  ).
  lv_index = lr_element->get_index( ).

Use this code in the onSelect method of radio button.

This code will give the index of the selected row. Get the values of the table in an internal table and read the value at that perticluar index.

I hope it helps.

Regards

Arjun

Edited by: Arjun Thakur on Mar 16, 2009 1:10 PM

Former Member
0 Kudos

Hi ,

Thanks all for ur response. I will try it out and let u all know...

Former Member
0 Kudos

Hi Arjun,

what is happening in this line.

lr_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).

The node i binded to the table is "INBOX", it is having a child node called "CHILD_INBOX" . CHILD_INBOX is having a attribute called "RADIO" which is binded to the radio button UI of the table. So what should i pass into the above statement.

Thanks,

Mugundhan

arjun_thakur
Active Contributor
0 Kudos

Kandha,

You don't have to pass any attribute name in this statement. Use it as it is.


lr_element = wdevent->get_context_element( name = 'CONTEXT_ELEMENT' ).

This line is used to get the selected row from the table. Use it in the OnSelect method of radio button.

To get the details about what this line is doing, refer this [thread|; and see the explaination given by Uday.

Regards

Arjun

Edited by: Arjun Thakur on Mar 16, 2009 1:38 PM

Former Member
0 Kudos

Ya Thanks Arjun, I got it...

Answers (2)

Answers (2)

vivekananthan_sellavel
Active Participant
0 Kudos

hi

in on_select event u wright the following code.

DATA:

node_bank TYPE REF TO if_wd_context_node,

lv_index type i.

node_bank = wd_context->get_child_node( name = if_v_temp=>wdctx_bank ).

CALL METHOD node_bank->get_attribute

EXPORTING

name = 'radio_attt'

IMPORTING

VALUE = lv_value

.

IF lv_value EQ X.

lv_index = node_bank->get_index( ).

node_bank->set_index( lv_index ).

ENDIF.

regards,

Vivekananthan.S

Former Member
0 Kudos

Thanks Vivekanathan,Your solution has solved my problem

Former Member
0 Kudos

Hi

Follow this thread.

I hope it helps.

Regards,

Rohit