cancel
Showing results for 
Search instead for 
Did you mean: 

how get the all the table values to another table based on Action

Former Member
0 Kudos

Hi All,

I am new to webdyn pro.

I have two tables Table1 and Table2 with context nodes Tab and Tab1.

Table1 I have a button Save If I submit Save the data from first table to second table .

I was written the code

IPrivateTableScrollBar.ITabElement element;

for(int i=0;i<10;i++)

{

element=wdContext.createTabElement();

element.setName("test"+i);

element.setSal("100"+i);

wdContext.nodeTab().addElement(element);

}

added some data to first table.

how can I get the all 10 rows from first table to second table if I write wdContext.node<Element>.getName() and getSal() I can get only selected one row .how can I get the all rows in a sigle click to second table.

please help.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi mohammed,

Use the following lines of code to iterate through the elements :

Iprivate<your view>.I<your node1 name>Element elmt1 = null;

Iprivate<your view>.I<your node2 name>Element elmt2 = null;

for(int i=0;i<wdContext.node<your node1 name>().size();i++)

{

elmt2 = wdContext.node<your node2 name>().create<your node2 name>Element();

elmt1 = wdContext.node<your node1 name>().get<your node1 name>ElementAt(i);

elmt2.set<attribute name>(elmt1.get<attribute name>);

wdContext.node<your node2 name>().addElement(elmt2);

}

Hope this helps,

Best Regards,

Nibu.

Answers (1)

Answers (1)

Former Member
0 Kudos

Mohammad,

If both nodes has same structure (attributes names and types) do the folowing:

WDCopyService.copyElements(wdContext.nodeTab() /* source /, wdContext.nodeTab1() /target*/);

Valery Silaev

EPAM Systems

http://www.NetWeaverTeam.com

P.S. In your code you seems to mix source and target