on 12-10-2007 10:28 AM
Hi All,
i am copying two node in to one node .how can copy that two nodes at a time to the node.can any body tell this its urgent...
check below...wat i did
if (wdContext.nodeBulkMatStatusXs() != null && wdContext.nodeBulkMatStatusXs().size() > 0)
{
WDCopyService.copyElements(wdContext.nodeBulkMatStatusXs(),wdContext.nodeBulkMatStatusSearchResultVN());
}
if(wdContext.nodeBulkMaterialTemp() !=null && wdContext.nodeBulkMaterialTemp().size()>0)
{
WDCopyService.copyElements(wdContext.nodeBulkMaterialTemp(),wdContext.nodeBulkMatStatusSearchResultVN());
}
Hi prasad,
In your code it will only copy the last node copied.
For resolving this issue do following thing.
copy first node like this.
(1)WDCopyService.copyElements(wdContext.nodeBulkMatStatusXs(),wdContext.nodeBulkMatStatusSearchResultVN());
(2)copy 2nd node like following
Iterator iter = wdContext.nodeBulkMaterialTemp().getNodeInfo().iterateAttributes();
for (int i = 0; i < wdContext.nodeBulkMaterialTemp().size(); i++) {
IWDNodeElement elem = wdContext.nodeBulkMatStatusSearchResultVN().createAndAddElement();
IWDNodeElement sourceEle = wdContext.nodeBulkMaterialTemp().getElementAt(i);
while(iter.hasNext()){
IWDAttributeInfo attr = (IWDAttributeInfo) iter.next();
String name=attr.getName();
elem.setAttributeValue(name, sourceEle.getAttributeValue(name));
}
}
This will solve your problem.
Regards,
Praveen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prasad,
WDCopyService provides u a few methods for copying the data.U can copy a single node at a time. If that node contains a child node & u want to copy main node with all the child nodes, u can use WDCopyService.copySubTree() method.
regards
Sumit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Prasad,
What is exactly your problem? Using WDCopyService.copyElements throws <b>WDRuntimeException</b> - if target is a model node and source is <b>not</b> a model node holding the same class.
regards,
Siva
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.