cancel
Showing results for 
Search instead for 
Did you mean: 

Get Selected Check Box from CheckBox Group

Former Member
0 Kudos

Hi All,

I have bind one table field into my CheckBox Group Control. I have to display the selected Check box value when user click the button.

how i can get the selected Check Box values from node through codeing?. Please help me to solve this problem

Regards,

Kumar K

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

I found the solution for this problem..

just i used the Get_Selected_elements() in bouded node in the CheckBoxGroup control.

arjun_thakur
Active Contributor
0 Kudos

Hi,

Get the index of the row in which the buttin is pressed with the help of help of code provided by Rohit.

Then get all the values of the table by using get_static_attributes_table( ) method and then simply read the value to get the value of the check box.

Refer the code below:


DATA lo_nd_node1 TYPE REF TO if_wd_context_node.
DATA lo_el_node1 TYPE REF TO if_wd_context_element.
DATA ls_node1 TYPE wd_this->element_node1.
lo_nd_node1 = wd_context->get_child_node( name = wd_this->wdctx_node1 ).
data: it_tab type table of wd_this->element_node1.
data: wa_itab type wd_this->element_node1.
lo_nd_node1->get_static_attributes_table(
importing
table = it_tab ). 
 
Read it_tab into wa_itab index lv_index.

I hope it helps.

Regards

Arjun

former_member40425
Contributor
0 Kudos

Hi,

Refer the following code to get the index of the row in which button has been pressed:

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( ).

Aftrer getting the row index of table you can select Check box of that row.

I hope it helps.

Regards,

Rohit

Former Member
0 Kudos

Hi,

Sorry i think you wronlgy undertood my doubt. Actually I have one CheckBox Group control with Data. and one Button.

If i click the button i have to display the selected Check Box Values into one TextView Control.

Regards,

Kumar K

Former Member
0 Kudos

Hi,

I think you have bound node to the checkbox group and might vae bound the ttexts to this node.

Implement the event handler ONTOGGLE for this checkbox group you will get the element that is selected in this event hanlder parameters.

Check the wdr_test_events for the same and the same requiremnet you can see the code for this event of this UI element.

Regards,

Lekha.