cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP: dynamic creation of nested elements

Former Member
0 Kudos

Hello,

I need to create a dropDown and put it into transparent container dynamically. Here is some things that I have:

Trasparent container:


  transparent_container = cl_wd_transparent_container=>new_transparent_container( ).
  cl_wd_grid_layout=>new_grid_layout( container = transparent_container ).
  cl_wd_grid_data=>new_grid_data( element = transparent_container ).
  ui_container->add_child( transparent_container ).

and a dropDown:


drop_down_figure = cl_wd_dropdown_by_key=>new_dropdown_by_key( bind_selected_key = 'REPOSITORY.FIGURES' on_select = 'GET_OPERATOR' ).
  cl_wd_grid_data=>new_grid_data( element = drop_down_figure ).
  ui_container->add_child( drop_down_figure ).

I need to put this dropDown inside trasparent container that was just created.

I can get reference to the container this way:

tr_cont = ui_container->get_child( index = 1 ).

return type of the above code is cl_wd_uielement.

I do not see any methods of this type that allow me to put dropDown inside this element.

Do I need to cast it to cl_wd_uielement_container type first? If so how is casting done?

Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

srinivasa_raghavachar
Participant
0 Kudos

Hi Georrgy,

Casting is done using "?=".

For ex:

DATA: THE_TABLE_CELL_EDITOR type ref to CL_WD_DROPDOWN_BY_KEY,

THE_TABLE_CELL_EDITOR ?= wd_table_column->GET_TABLE_CELL_EDITOR( ).

Here I am getting a table cell editor which can be of any type say dropdown, Link to Action etc and since I need dropdown I am casting it using "?=".

Regards,

Srini.

Answers (0)