cancel
Showing results for 
Search instead for 
Did you mean: 

How to check dynamically checkbox by click on Buutton

Former Member
0 Kudos

Hi ,

I have a requirement to create the check box dyna,ically based upon the field records.which is done.

But i am facing one more issue

Issue:- after getting the check box(for ex:- 4 check box which is based on field records), i want to check one check box and then click on the button1 that time only one check box should be checked , but all the checkbox is ggeting checked ,

could any body tell me how check only check box out of four dynamic check box.

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

ok

Former Member
0 Kudos

Hi Rakshar,

Can you provide the steps you used to know that which ckeckbox is being checked. So that it would be

possible to tell the reason why you are getting all the checkboxes as checked.

Former Member
0 Kudos

LOOP AT IT_FIELDS_CNTRL1 INTO WA_FIELDS_CNTRL1 .

  • AT END OF FIELDGROUP_R.

MOVE WA_FIELDS_CNTRL1-FIELDGROUP_R TO IV_TEXT.

******original code*******

              • ENDAT.

LR_CONTAINER ?= VIEW->GET_ELEMENT( 'ROOTUIELEMENTCONTAINER' ).

LR_CHECKBOX = CL_WD_CHECKBOX=>NEW_CHECKBOX(

TEXT = IV_TEXT " 'WD_Processor'

BIND_CHECKED = 'CHECK_BOX_NODE.CHECK_BOX_VALUE'

VIEW = VIEW ).

*CL_WD_MATRIX_DATA=>NEW_MATRIX_DATA( ELEMENT = LR_CHECKBOX ).

CL_WD_MATRIX_DATA=>NEW_MATRIX_DATA( EXPORTING

ELEMENT = LR_CHECKBOX

RECEIVING

CONTROL = LO_MATRIX_DATA ).

LR_CHECKBOX->SET_LAYOUT_DATA( LO_MATRIX_DATA ).

LR_CONTAINER->ADD_CHILD( LR_CHECKBOX ).

former_member182372
Active Contributor
0 Kudos

Rakshar, you bind UI property of all your checkboxes to the same context attribute - no wonder they all got checked when you change the value of that attribute. What you can do - create attribute dynamically for for each checkbox (CHECK_BOX_VALUE_N) under CHECK_BOX_NODE node and bind that newly created attribute to the CHECKED property.

See more here