on 08-23-2010 12:59 PM
Hi all,
I have two nodes node1 and node2 with same structure.I want to append the elements of node2 to node1.
I dont want to add attribute by attribute as the structure of bot the nodes are same.
Please let me know how to do this.
Thanks and Regards,
Rajesh
Hi Rajesh,
Please crosscheck cardinality of the nodes while using CopyCorresponding statements,otherwise it will throws a error.
Thaks,
Sukalyan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Rajesh,
You can use the function copyelements of WDCopyService it will copy all the elements
WDCopyService.copyElements(<source node>, <target node>
);
And yeah you need to add WDCopyService in your code by writing the import statement
import com.sap.tc.webdynpro.progmodel.api.WDCopyService;
THanks
Regards,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Use the following code:
for(int i = 0; i < node1.size(); i++)
{
node2Element = wdContext().createAndAddnode2Element();
WDCopyService.copyCorresponding(wdContext().nodenode1().getNode1ElementAt(i), node2Element);
}
Regards,
Poojith MV
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
make use of the WDCopyService .
[WDCopyService|http://help.sap.com/javadocs/NW04S/SPS09/wd/com/sap/tc/webdynpro/progmodel/api/WDCopyService.html]
above link will help to know about it.
regards,
ramesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.