Code to create dynamic context elements
I have create a dynamic text edit using the following code in abap webdynpro.
I have created a transparent container named PREREPLY set to grid layout and created a context REPLY type string and in WDDOMODIFYVIEW view i have written the following
data : lr_container type ref to cl_wd_uielement_container,
lr_comment type ref to cl_wd_text_edit.
lr_container ?= view->get_element( 'PREREPLY' ).
lr_comment = cl_wd_text_edit=>NEW_TEXT_EDIT( BIND_VALUE = 'REPLY'
COLS = 70
ID = 'PREREPLIES2'
STATE = 01 ).
lr_comment->BIND_VALUE( 'REPLY' ).
cl_wd_grid_data=>new_grid_data( element = lr_comment ).
lr_container->ADD_CHILD( lr_comment ).
i am able to see a new textedit when i run my application.
Now I want to create the context also dynamically, because i will not know how many text edit will be there. Based on the number of lines in the internal table i want the create the context and textedits dynamically.
Give me the code to create context dynamically in abap webdynpro.