on 07-02-2007 3:59 PM
I have an view & window..Window has the node called Master which is mapped to view context node as "master"..
Now I want this data to be passed to another table in the view called "Target".
<b>Here is the code:</b>
IPrivateDialogView.ITargetNode TargetNode = wdContext.nodeTarget();
IPublicHRDashboard.IMasterNode masterNode = wdThis.wdGetMYController().wdGetContext().nodeMaster();
int size = masterNode.size();
for (int i = 0; i <= size; i++)
{
IPrivateDialogView.IMasterElement masterElement = wdContext.nodeMaster().getMasterElementAt(i);
IPrivateDialogView.ITargetNode node = wdContext.nodeTarget();
IPrivateDialogView.ITargetElement element = node.createTargetElement();
WDCopyService.copyCorresponding(masterElement, element);
node.addElement(element);
}
}
catch(Exception e)
{
}
<b>My issue is,</b> if i display the Target node in a table, only one Row is repeating everytime.
But if i display the Master node in a table UI element, i can see all the records properly.
What is the issue in my code...
BM
Hi Bharathi,
You want to copy the entire contents of MasterNode to TargetNode
<b>IPublicHRDashboard.MasterNode masterNode = wdThis.wdGetMYController().wdGetContext().nodeMaster();
IPrivateDialogView.ITargetNode TargetNode = wdContext.nodeTarget();
WDCopyService.copySubtree((IWDNode)masterNode,(IWDNode)TargetNode);</b>
Regards,
Mathan MP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bharathi,
To copy data from master node to target node
try
{
IPrivateDialogView.ITargetNode TargetNode = wdContext.nodeTarget();
IPrivateDialogView. IMasterNode masterNode = wdContext.nodeMaster();
int size = masterNode.size();
for (int i = 0; i < size; i++)
{
IPrivateDialogView. IMasterElement masterElement = (IPrivateDialogView. IMasterElement)wdContext.nodeMaster ().getElementAt(i);
IPrivateDialogView.ITargetNode node = wdContext.nodeTarget();
IPrivateDialogView.ITargetElement element = node.createTargetElement();
WDCopyService.copyCorresponding(masterElement, element);
node.addElement(element);
}
}
catch(Exception e)
{
e.printStackTrace();
}
or you can use this code also
try{
WDCopyService.copyElements(wdContext.nodeMaster(),wdContext.nodeTarget());
}
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 Bharthi,
There's nothing wrong with the presented code as far as copying of the NodeElements are considered.Can you debug the application and see at the time of copying what are the elements in the source Node
and also the Node Structure.
Regards
Amit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bharathi,
What's the cardinality u r using for Target node ???
regards
Sumit
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.