on 09-13-2005 9:04 AM
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
P.S. In your code you seems to mix source and target
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.