on 01-09-2006 5:40 AM
Hi All,
Is there any efficient way to copy data from model nodes to value nodes without writing the long code like wdcontext.currentnodenameElement.setAttributeName(wdcontext.nodeModelNodeelement.getAttributeElentmtAt.getAttributeName()) if the attributes are in large no its tedious to write code so is there any method for that . note: model nodes and value node name are same and they have same attributes.
Thanks.
Yashpal
Hi Yashpal,
You can copy all the elements of a node to another node through the WDCopyService.copyElements(sourceNode,destNode) method, provided they have the same attributes.
WDCopyService.copyElements(
wdContext.node<your modelnode>(),wdContext.node<your value node>()
);
Hope this helps,
Best Regards,
Nibu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yash,
I found the following code while seraching this forum:-
you can copy the data in the model node like this
for(int i=0; i<wdcontext.node<model node name>.size(); i++)
{
iprivate<yourviewname or yourcontrollername>.i<valuenodename>element ve = wdcontext.create<valuenode>element();
ve.set<attributename>(wdcontext.node<modelnodename>.getElementAt(i).get<Attribute name>();
// this way set all the coreesponding attributes of model node and vale node
wdcontext.node<valuenodename>.addElement(ve);
}
Regards,
Chintan Virani.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey YashPal,
IMO i guess you have follow this tedious procedure.
Regards,
Chintan Virani.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
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.