cancel
Showing results for 
Search instead for 
Did you mean: 

Error in wddomodifyview

former_member474221
Participant
0 Kudos

I am getting a runtime error in wddomodifyview

I want to set the layout of 'rootuielementcontainer' to Matrix layout and then add 2 UI elements ....one button and one textview with Matrix head data so that they start in a new line....

I have written the following code

if first_time = 'X'.

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

lr_matrix = cl_wd_matrix_data=>new_matrix_data( element = lr_container ).

lr_textview = cl_wd_text_view=>new_text_view( view = view

text = 'Welcome to Dynamic Layout Design' ).

lr_matrix_head = cl_wd_matrix_head_data=>new_matrix_head_data( element = lr_textview ).

lr_textview->set_layout_data( lr_matrix_head ).

lr_container->add_child( lr_textview ).

lr_button = cl_wd_button=>new_button( view = view

text = 'Create Button'

on_action = 'CLICK' ).

lr_matrix_head = cl_wd_matrix_head_data=>new_matrix_head_data( element = lr_button ).

lr_button->set_layout_data( lr_matrix_head ).

lr_container->add_child( lr_button ).

Error -

Adapter error in &VIEW_ELEMENT_TYPE& "_02" of view "Z_DYNAMIC.MAIN": LayoutData type "MATRIX_HEAD_DATA" for chile element "_04" is not permitted

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member474221
Participant
0 Kudos

sloved myself

former_member199125
Active Contributor
0 Kudos

Hema,

As this is learning place, i would suggest you to post the answer and how u solved

Regards

Srinivas

Former Member
0 Kudos

Hi Srinivas,

This error occurs when the layout of the ROOTUIELEMENTCONTAINER is different than the one specified for the element in the code.

For example: say, in the frontview layout u are defining the layout of  ROOTUIELEMENTCONTAINER as flowlayout but in code if u r trying to use the element according to matrix layout, like:

    lr_matrix = cl_wd_matrix_data=>new_matrix_data( element = lr_container ).

this wont work.

Both the layouts of  ROOTUIELEMENTCONTAINER & element in code must be the same.

Hope this helps.

Regards,

Azhar.