on 10-22-2010 2:27 PM
Hi all,
I am trying to code a dynamic textview with a menu.
So the point of it would be to click on the textview and get a menu that pops open under the textview.
The menu is an ui element, and when I make it statically everything goes well... but when I try this code, I don't get the menu...
Data lo_txv type ref to cl_wd_text_view.
Data lo_menu type ref to cl_wd_menu.
Data lo_menu_action_item type ref to cl_wd_menu_action_item.
lo_txv = cl_wd_text_view=>new_text_view( ID = 'TEST' TEXT = 'TEXT' ).
lo_menu = cl_wd_menu=>new_menu( ID = 'MENU' TITLE = 'TITLE' ).
lo_menu_action_item = cl_wd_menu_action_item=>new_action_item( ID = 'ITEM1' TEXT = 'ITEM1' ON_ACTION = 'EMPTY_ACTION' ).
lo_menu->add_item( lo_menu_action_item ).
lo_menu_action_item = cl_wd_menu_action_item=>new_action_item( ID = 'ITEM2' TEXT = 'ITEM2' ON_ACTION = 'EMPTY_ACTION' ).
lo_menu->add_item( lo_menu_action_item ).
lo_txv->set_menu( lo_menu )
.
This code should give me a textview with a menu with 2 items... but it doesn't.
Could someone please help me out ??
Thanks in Advance,
David Bellers
Hi David,
I don't see code where you add the textview to your View? But I suppose you coded that as well..
Try to add LayoutData to your TextView (for example: MatrixHeadData)?
Regards,
Roelof
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your reply,
I didn't write the code down for the matrixlayout, but it is correctly implemented.
Do I have to add the view to the textview?
When programming dynamically I've never had to work with the view itself, most of the time,
I add the elements to a container and that container is in the view...
Just to have everything I'll change the code to do every exact step...
Data lo_txv type ref to cl_wd_text_view.
Data lo_menu type ref to cl_wd_menu.
Data lo_menu_action_item type ref to cl_wd_menu_action_item.
lo_txv = cl_wd_text_view=>new_text_view( ID = 'TEST' TEXT = 'TEXT' ).
lo_menu = cl_wd_menu=>new_menu( ID = 'MENU' TITLE = 'TITLE' ).
lo_menu_action_item = cl_wd_menu_action_item=>new_action_item( ID = 'ITEM1' TEXT = 'ITEM1' ON_ACTION = 'EMPTY_ACTION' ).
lo_menu->add_item( lo_menu_action_item ).
lo_menu_action_item = cl_wd_menu_action_item=>new_action_item( ID = 'ITEM2' TEXT = 'ITEM2' ON_ACTION = 'EMPTY_ACTION' ).
lo_menu->add_item( lo_menu_action_item ).
lo_txv->set_menu( lo_menu ).
cl_wd_matrix_head_data=>new_matrix_head_data( element = lo_xv ).
container->add_child( the_child = lo_txv ).
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.