on 10-18-2008 4:34 PM
Hi,
I have a node with one arrtribute and a child node. The parent node is bound to a table ui element.I want to add a new row to the table in a button click.
Before i have done with single node and it was working fine.But i have one child node inside the node.
That is the problem.
solved
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ramanan,
I think you are creating an element of the node (bounded to the table) and are facing problems.
Please create an element of the child node also and the add it to parent node.
I think this is the problem.
In case of issues please revert back with cardinalities of the nodes, your code and cardinalities of the nodes.
I hope it helps.
Regards,
Sumit Oberoi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ramanan,
Please make the 'emp detals' node as a singletn node.
Then apply the following code.
first_node_elem type ref to if_wd_context_element
child node type ref to if_wd_context_node
child_node_elem type ref to if_wd_context_element
first_node_elem = first_node->create_element( ).
* Set attributes
first_node_elem->set_attribute(
name = 'Emp_number'
value = 10000
).
first_node-.bind_element(
new_item = first_node_elem
set_initial_elements = abap_false).
* Create Child node
child_node = wd_context->get_child_node( 'Emp_Details' ) .
child_node_elem = child_node->create_element( ).
*Set child attributes
child_node_elem->set_attributes(
name = 'Name'
value = 'Ramanan'
).
child_node->bind_element(
new_item = child_node_elem
set_initial_elements = abap_false).
I hope it helps.
Regards,
Sumit Oberoi
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.