cancel
Showing results for 
Search instead for 
Did you mean: 

how to make checkbox checked by default

Former Member
0 Kudos

hi,

i have created a checkbox and binded the 'Checked' property of the checkbox to a attribute of type WDY_BOOLEAN. I have set the attibute value to 'True' in my code. but this s not working. Pls can anybody tel me where i have went wrong ?

DATA lo_nd_check_box TYPE REF TO if_wd_context_node.

DATA lo_el_check_box TYPE REF TO if_wd_context_element.

DATA ls_check_box TYPE wd_this->element_check_box.

lo_nd_check_box = wd_context->get_child_node( name =

wd_this->wdctx_check_box ).

lo_el_check_box = lo_nd_check_box->get_element( ).

    • get all declared attributes

lo_el_check_box->set_attribute(

EXPORTING

name = 'text'

value = 'true' ).

thanks,

aishwarya.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

insted of true you have to pass 'X" or abap_true

** get all declared attributes
lo_el_check_box->set_attribute(
EXPORTING
name = 'TEXT'   " always PASS it in CAPS 
value = 'abap_true' ).

Edited by: chinnaiya pandiyan on Nov 16, 2011 12:46 PM

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Please try with the below code hope it helps.

DATA lo_nd_inp_sflight TYPE REF TO if_wd_context_node.

DATA lo_el_inp_sflight TYPE REF TO if_wd_context_element.

DATA ls_inp_sflight TYPE wd_this->element_inp_sflight.

DATA lv_chkgrp LIKE ls_inp_sflight-chkgrp.

  • navigate from <CONTEXT> to <INP_SFLIGHT> via lead selection

lo_nd_inp_sflight = wd_context->get_child_node( name = wd_this->wdctx_inp_sflight ).

  • get element via lead selection

lo_el_inp_sflight = lo_nd_inp_sflight->get_element( ).

  • get single attribute

lo_el_inp_sflight->set_attribute(

EXPORTING

name = `CHKGRP`

value = abap_true ).

Regards,

Basuvaraj.P