cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic creation of checkbox

Former Member
0 Kudos

Hi,

I want to dynamically create a checkbox in the layout. Can anyone give me sample coding how to create the same. Please don't give me sample coding for creating dynamic buttons as this doesn't work for checkbox.

Thanks in advance.

Regards,

Satheesh Raja.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

lo_container ?= m_view->get_element( 'name of layout container' ).

lo_checkbox = cl_wd_checkbox=>new_checkbox(

bind_checked = attribute_path

id = attr_ui_element_id

view = m_view ).

cl_wd_'layout type' =>new_'layout type'_data( element = lo_chackbox ).

lo_container->add_child( lo_checkbox ).

with layout type eg grid_layout

grtz

Koen

Message was edited by:

Koen Labie

Former Member
0 Kudos

Hi Koen,

Thanks for your reply.

Can you please tell me how you get the values of 'attribute_path', 'attr_ui_element_id' and 'm_view' in

lo_checkbox = cl_wd_checkbox=>new_checkbox(

bind_checked = attribute_path

id = attr_ui_element_id

view = m_view ).

Regards,

Satheesh Raja.

Former Member
0 Kudos

Hi,

attribute_path is something like NODE1.SUBNODE1.ATTRIBUTENAME

depending on your nodes in your context (what you get in the checked box when you

declare your checkbox on designtime)

'attr_ui_element_id' is your id on your view, this is what you put in the id field in the

layout pane, naming conventions point at CKB_'name of checkbox' as id,

if i'm not mistaken.

m_view is the instance of the view, in wddomodifyview, it's an importing parameter,

you should bind it there to the attribute m_view in the view attributes.

put this in wddomodifyview:

if first_time is not initial.

wd_this->m_view = view.

endif.

and in the attributes pane: m_view type ref to if_wd_view

grtz

Koen

Answers (0)