cancel
Showing results for 
Search instead for 
Did you mean: 

The same rows are in the table

Former Member
0 Kudos

Hi,

I have a web dynpro with 2 equal contexts. First context (node1) contains data (4 different entries) and the second (node2) is empty (0 entries).

I want copy it to second context. I have used the following code:

IWDNode srcNode = (IWDNode)wdContext.node1();

IWDNode destNode = (IWDNode)wdContext.node2();

WDCopyService.copySubtree(srcNode,destNode);

Now destNode has the same data that srcNode (4 different entries). I have verified it.

In my layout I have a table witch dataSource is node2.

When I execute my web dynpro, the table has <b>4 EQUAL ROWS</b> (the last entry of node1).

What happend? How I could solve this?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Anja,

It is better to loop throgh source node and create element of destnode, set the values and add element to destnode.

IWDNode srcNode = (IWDNode)wdContext.node1();
IWDNode destNode = (IWDNode)wdContext.node2();
srcNode.moveFirst();
for(int i=0;i<srcNode.size;i++)
{
destNodeElement a= destNodeElement.createElement();
a.set....
destNode.addelement(a);
}

Regards,

ganga.

Answers (2)

Answers (2)

Former Member
0 Kudos

I solved it.

Thanks a lot.

Former Member
0 Kudos

Please post the exact context structure and how the table is bound to the context.

Armin