on 06-07-2011 10:30 AM
Hi,
I'd like to create a dynamic node in my component controller then map this node to a node in my view and bind it to a dynamic table.
I create the dynamic node in my component controller using the add_new_child_node method :
CALL METHOD root_node_info->add_new_child_node
EXPORTING
name = 'MY_TABLE'
static_element_rtti = struct_type
is_static = ABAP_true
RECEIVING
child_node_info = node_info
.
Then I use the add_new_mapped_child_node method to map the node in the view :
* Map the context node dynamically
wa_path = 'COMPONENTCONTROLLER.MY_TABLE'.
insert wa_path into table tab_mapping_path.
stru_mapping_info-controller = 'COMPONENTCONTROLLER'.
stru_mapping_info-path = tab_mapping_path.
lo_node_info = wd_context->get_node_info( ).
CALL METHOD lo_node_info->add_new_mapped_child_node
EXPORTING
child_name = 'MY_TABLE'
mapping_info = stru_mapping_info
receiving
child_node_info = lo_dyn_node_info
.
The child node is created in my view context but it doesn't have any attribute or static element RTTI.
Do I have to add each attribute with the add_attribute method and then the add_new_mapped_child_node method will copy them over?
Regards,
Pierre
hi,
I havent tried add_mapped_child_node but dynamically creating node using rtti.
providing struct_type was enough. It created the node with the structure in it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Problem solved, the path was not good :
* Map the context node dynamically
* wa_path = 'COMPONENTCONTROLLER.MY_TABLE'.
* insert wa_path into table tab_mapping_path.
stru_mapping_info-controller = 'COMPONENTCONTROLLER'.
* stru_mapping_info-path = tab_mapping_path.
append 'COMPONENTCONTROLLER' to stru_mapping_info-path.
append 'MY_TABLE' to stru_mapping_info-path.
lo_node_info = wd_context->get_node_info( ).
CALL METHOD lo_node_info->add_new_mapped_child_node
EXPORTING
child_name = 'MY_TABLE'
mapping_info = stru_mapping_info
receiving
child_node_info = lo_dyn_node_info
.
Regards,
Pierre
User | Count |
---|---|
85 | |
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.