cancel
Showing results for 
Search instead for 
Did you mean: 

Issue with Table

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Answers (3)

Answers (3)

former_member751941
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Bharathi,

What's the cardinality u r using for Target node ???

regards

Sumit

Former Member
0 Kudos

0:n..

My issue is, one row is keep repeating in the target node...

BM

Former Member
0 Kudos

Hi Bharathi,

try this:

WDCopyService.copyElements(IWDNode source,IWDNode target).

Just let me know,if thats also not working,

regards

Sumit