on 07-09-2009 9:36 AM
Hi Everybody ,
I am working on dynamic creating ui ELEMENTS . iI want to create buttons dynamically in tab strip . And i dont know how many buttons i have to create also in design time .so i want to create actions also dynamically and assigneg actions to event handlers . And assignging event handlers to butoons. Pl help is there any way to achieve this . If code is there its help ful .
Thanks in advance ,
Vijay vorsu
Hi Vijay,
here is a sample code.
method WDDOMODIFYVIEW .
data : lr_textview type ref to cl_wd_text_view.
Data:lr_container type ref to cl_wd_uielement_container,
lr_row_head type ref to cl_wd_row_head_data,
lr_button type ref to cl_wd_button,
lr_input type ref to cl_wd_input_field,
lr_flow_data type ref to cl_wd_flow_data,
lv_child_id type string.
if first_time = 'X'.
lr_button = cl_wd_button=>new_button( view = view
text = 'Create Button'
on_action = 'CLICK' ).
lr_row_head = cl_wd_row_head_data=>new_row_head_data( element = lr_button ).
lr_button->set_layout_data( lr_row_head ).
lr_button->set_tooltip( value = 'Tooltip' ).
lr_flow_data = cl_wd_flow_data=>new_flow_data( element = lr_button ).
lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
lr_container->add_child( lr_button ).
lr_textview = cl_wd_text_view=>new_text_view( view = view
text = 'Welcome to Dynamic Layout Design' ).
lr_row_head = cl_wd_row_head_data=>new_row_head_data( element = lr_textview ).
lr_textview->set_layout_data( lr_row_head ).
lr_flow_data = cl_wd_flow_data=>new_flow_data( element = lr_textview ).
lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
lr_container->add_child( lr_textview ).
endif.
endmethod.
Kind Regards
Sajid
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Action assigned dynamically can only refer to existing server side action handler method.It is not possible to define sourse code of action handler method,but it possible to define which existing action handler will be called when client side event is caught.
suppose you have created a button ..the static method new_button of class cl_wd_button is used to create button,this method allows you to assign the action using the importing parameter on_action.
Here you can mention some existing action for which action handler method is already created
hi,
Dynamic ui elements should be written in wddomodifyview method.
Regards
Sajid
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
11 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.