on 07-24-2007 4:32 AM
Copy Model Node to another Value Node
the structure like this
-NodeOutput (ModelNode)
-NodeMgr
-NodeOU
-NodeCalendar
-NewNodeOutput (ValueNode)
-NewNodeMgr
-NewNodeOU
-NewNodeCalendar
pls advice how to i copy the NodeOutput to NewNodeOutput same structure and same attribute.......
Message was edited by:
yzme yzme
Use :
WDCopyService.copyElements(NodeOutput, newNodeOutput );
for each node you want to copy.
Regards,
Ashwani Kr Sharma
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi yzme,
You can use this also.
try
{
IPrivate<put View Name>.INewNodeOutputNode NewNodeOutputNode = wdContext.nodeNewNodeOutput();
IPrivate<put View Name>.INodeOutputNode masterNode = wdContext.nodeNodeOutput();
int size = masterNode.size();
for (int i = 0; i < size; i++)
{
IPrivate<put View Name>.INodeOutputElement masterElement = (IPrivate<put View Name>.INodeOutputElement)wdContext.nodeNodeOutput().getElementAt(i);
IPrivate<put View Name>.INewNodeOutputNode targetNode = wdContext.nodeNewNodeOutput();
IPrivate<put View Name>.INewNodeOutputElement targetElement = targetNode.createNewNodeOutputElement();
WDCopyService.copyCorresponding(masterElement, targetElement);
targetNode.addElement(targetElement);
}
}
catch(Exception e)
{
e.printStackTrace();
}
Or
try
{
WDCopyService.copyElements(wdContext.nodeNodeOutput(),wdContext.nodeNewNodeOutput ());
}
catch(Exception e)
{
e.printStackTrace();
}
Regards,
Mithu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
1)First context map your model to component controller....
2)then u copy from componentcontroller to view....
Use this code in wdDoInit();
{
IWDNode srcNode = (IWDNode)wdThis.wdGetFlightCompController().wdGetContext().nodeOutput();
IWDNode destNode = (IWDNode)wdContext.nodeNewNodeOutput();
WDCopyService.copySubtree(srcNode,destNode);
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If there is subnode under a node, you have call the
WDCopyService.copyElements(); for each subnode also
OR use the method
WDCopyService.copySubtree(NodeOutput , newNodeOutput , true);
Read the javadoc also for these methods by pressing F2 on the method. Will be useful while using them.
Regards,
Ashwani Kr Sharma
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.