cancel
Showing results for 
Search instead for 
Did you mean: 

CheckBox selection

Former Member
0 Kudos

Hi,

I have 4 checkboxes and One Button in my Application.

If I press the Button,

I want my 4 check boxes to be selected. ( Like select all in Normal ABAP ).

Can you please tell me how can I do this?

Regards

Sandeep Reddy

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Create context attributes CHKBOX1, CHKBOX2, CHKBOX3, CHKBOX4 for the checkboxes and bind it to the checkbox UI.

in the On click on button event set the attributes of the checkboxes as below.

l_elem->set_attribute( exporting name = 'CHKBOX1'.

value = 'X' ).

l_elem->set_attribute( exporting name = 'CHKBOX2.

value = 'X' ).

l_elem->set_attribute( exporting name = 'CHKBOX3'.

value = 'X' ).

l_elem->set_attribute( exporting name = 'CHKBOX4'.

value = 'X' ).

Answers (3)

Answers (3)

arjun_thakur
Active Contributor
0 Kudos

Hi Sandeep,

You want to check all 4 check box when the button is clicked: For that create an attribute of WDY_BOOLEAN type and bind it with the checked property of all the check boxes. Now in the ONACTION method of the button, simply set the value of this attribute as 'X' with the help of code wizard (Ctrl+F7).

I hope it helps.

Regards

Arjun

Former Member
0 Kudos

Are these checkboxes in a table column or individual uielements.

If individual uielements just set all the 4 attributes to X using the following code

data: l_elem type ref to if_wd_context_element.

l_elem = wd_context->get_element( ).
l_elem->set_attribute( exporting name = 'ATTRIBUTE NAME'
                                 value = 'X' ).

If it is a table column, then modify the table by passing 'X' to the attribute and bind the table again.

Regards,

Radhika.

Former Member
0 Kudos

If you have already bind the checkboxes to a context, then you can simple set the checkbox context attribute value as 'X' in the action of the button. It makes the checkboxes selected.

Regards,

Trikanth