cancel
Showing results for 
Search instead for 
Did you mean: 

WDCopyService copySubTree

Former Member
0 Kudos

Dear all,

I was wondering about the functionality of WDCopyService.copySubTree(...) ...

In the documentation it says that this copies the nodes and the subnodes with equal names... But is this only intented for copying between different controllers then? because a node name has to be unique within the context...

Kind regards,

J.

The goal is to build a TableFilter without having to define the extra nodes at designtime... (so i have to implement a way to copy node A to node copyOfNodeA (recursively on the subnodes too) and the copying all the data (knowing that a nodeX becomes copyOfNodeX) )

Accepted Solutions (1)

Accepted Solutions (1)

ChrisPaine
Active Contributor
0 Kudos

A point well made.

If you have a context tree which have nodes underneath them - such that

NodeA contains NodeB contains NodeC

then it may be useful to copy information from NodeB(1) to NodeB(2). Same controller.

For your purposes of building a generic table filter I suggest that IWDNode is an awkward thing to deal with and standard Java collections are much nicer. You may have to build a routine to recurse through the IWDNodeInfo attributes. to pull all the data out and store it elsewhere dynamically.

Are you dynamically building the table that needs to be filtered?

Cheers,

Chris

Former Member
0 Kudos

With nodeB(1) and nodeB(2) you mean the parent element they belong to? so this is in case that nodeB is not a singleton node?

I have a component where i dynamically build a table, so i have the data in some custom objects.. but this isnt a necessity for the generic tablefilter class...

I already have a TableSorter class, that's a remake of the tablesorter class found on here. I remade it because i wanted to sort on multiple columns....

Now i want a generic tablefilter class that doesnt care if the table is built dynamically or not, it just receives a table and the data before the filtering... So that's why i wanted to store it in iwdnode instance in my tablefilter class, because those objects already exist... But it has to be a real copy of the data and not a referenced one, because otherwise my datasource will shrink too and i loose my original data...

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Joren,

It copies all elements from complete subtree of source to target & it can be used with same controller.

regards

Sumit

Former Member
0 Kudos

if u have the following...

nodeA nodeA_bis

subnodeB subnodeB_bis

with WDCopyService( nodeA, nodeA_bis) .... the result is that nodeA_bis contains the values of nodeA (on attribute level) but subnodeB_bis is still empty because its not copied because the name of the node is different....

So it doesnt copy all subnodes unless they have the same name?