on 02-10-2010 8:02 AM
Hi all,
I am trying to create UI Elements dynamically.
I have written code in modifyview.
First am displaying a dropdown box for sflight details. Am able to see this in my output window.
But when I use the dropdown option and select any value, I get the following error.
No layout data has been specified for child element "" in the UI element container
Can any explain why this is happening?
Thanks in advance.
Hi,
When you make a selection in DropDownList DoModifyView will be triggered again...
are you taking care that elements are generated only once...
This could be the problem..check on this..
Regards
Manas Dua
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Mohamed Aslam,
First of all, it is nothing to do with First_time variable provided by the framework, it is with something else. and even if you dont use the variable it will not give you the error but it will be slow as anytime you do activity on the application it would trigger modify view method.
NOW coming to solution. If you could recall or may be do it to realize the reason, whenever we include ui element in the view, we define the layout data in the properties. for ex when we define matrix layout,,,we define whether ui element has "matrixheaddata" or "matrixdata"
Regards
Anurag Chopra
Hello Aslam,
May be you could refer the below code.
You need to include the following code in the wddomodifyview method of view.
DATA: l_root_cnt TYPE REF TO cl_wd_uielement_container,
l_text_view TYPE REF TO cl_wd_text_view,
l_flow_data TYPE REF TO cl_wd_flow_data.
Check whether the method is called for the first time
IF first_time = abap_true.
Get the reference for thr ROOTUIELEMENTCONTAINER
l_root_cnt ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).
Call the method(generally starts with word new) of the corresponding class(UI specific)
here I have used textview, you can replace it with dropdrown UI element.
l_text_view = cl_wd_text_view=>new_text_view( id = 'TEXT_VIEW_ID'
text = 'YOUR TEXT' ).
l_root_cnt->add_child( l_text_view ).
Decide on the layout property of the UI Element. use the below class if rootuielementcontainer has "flowlayout".
l_flow_data = cl_wd_flow_data=>new_flow_data( element = l_text_view ).
ENDIF.
Regards
Anurag Chopra
Hello Aslam,
Is your question still unanswered ?
Regards
Anurag Chopra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Its not completely solved. Just now i found that when i create table dynamically this layout error comes.
Code for creating table
CALL METHOD cl_wd_dynamic_tool=>create_table_from_node
EXPORTING
ui_parent = lr_container
table_id = 'MY_TABLE'
node = lo_nd_sflight
RECEIVING
table = lr_table.
so i added the following code to solve this.
CLEAR lr_matrix.
lr_matrix = cl_wd_matrix_head_data=>new_matrix_head_data( lr_TABLE ).
lr_table->set_layout_data( lr_matrix ).
CALL METHOD lr_container->add_child
EXPORTING
index = 1
the_child = lr_table.
Now what happens is my table is being created but twice. When i debug the code control goes to this place only once.
Is there anything with my second part of code which makes this table being created twice.
I referred the following link for creating this application.
http://wiki.sdn.sap.com/wiki/display/WDABAP/CreatingUIElementsDynamicallyinAbapWebdynpro+Application
I have only added the second part of code given above in addition to what ever is available in the link.
But i am not aware why the table is being created twice?
User | Count |
---|---|
83 | |
10 | |
10 | |
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.