cancel
Showing results for 
Search instead for 
Did you mean: 

create checkbox runtime

Former Member
0 Kudos

dear all,

can you help me how to create checkbox during runtime?

thanks.

br,

donna

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Let's make an example where we create a Group that gets a MatrixLayout and resides within a container that has a FlowLayout

method wddomodifyview.

data:

lr_container type ref to cl_wd_uielement_container,

lr_group type ref to cl_wd_group.

  • get a pointer to the RootUIElementContainer

lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).

  • create the group and add it to the container

lr_group = cl_wd_group=>new_group( ).

cl_wd_flow_data=>new_flow_data( element = lr_group ).

cl_wd_matrix_layout=>new_matrix_layout( container = lr_group ).

lr_container->add_child( lr_group ).

endmethod.

Cheers,

K.Lakshmi.

Former Member
0 Kudos

Hi,

Write in wd_do_modify_view().

Data: lr_ui_root type ref to if_wd_view_element,

Lr_container type ref to cl_wd_uielement_container.

*get reference to any node

Lr_ui_root = view->get_element(

Exporting

Id = ‘ROOT UIELEMENTCONTAINER’).

Lr_container ?= lr_ui_root.

*set container properties

Call method cl_wd_matrix_layout=>new_matrix_layout

Exporting

Container = lr_container.

*set width

Call method lr_container-.set_width

Exporting

Value = ‘100%’.

Data :lr_check_box type ref to cl_wd_checkbox.

lv_cb_id type string,

lv_bind_checked type string,

lr_cb_new type ref to cl_wd_checkbox,.

Lr_check_box =cl_wd_checkbox=>new_checkbox(

exporting

id = lv_cb_id

bind_checked = lv_bind_checked

read_only = 'X'

receiving

control = lr_cb_new ).

Lr_container->add_child(exporting the_child = lr_check_box).

Former Member
0 Kudos

Hello Donna,

Please read these: [/people/thomas.szcs/blog/2005/12/28/dynamic-programming-in-web-dynpro-abap--introduction-and-part-i-understanding-ui-elements], [https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2915] [original link is broken] [original link is broken] [original link is broken]; and [https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2953] [original link is broken] [original link is broken] [original link is broken];.

Regards,