on 12-12-2007 9:37 PM
I have a node - 'outnode'.
I have three records - two records with fieldvalue '1' and one record with a value '2'.
at the max only two diff values possible.
Now.. I need to create two tables : first one should have the two records with value 1 and second table with a record that has value '2'.
Please help.
Hi!
You can do it this way :
//fill outnode with dummy data
boolean b = false;
for (int i = 1; i <= 101; i++)
{
IPrivateExampleView.IOutnodeElement outNodeElement =
wdContext.createOutnodeElement();
if (b){
outNodeElement.setFieldValue(1);
b = !b;
}
else{
outNodeElement.setFieldValue(2);
b = !b;
}
wdContext.nodeOutnode().addElement(outNodeElement);
}
//fill tables 1 (nodeSourceTable1) and 2 (nodeSourceTable2)
//according to outnode's values
for (int i=0; i<wdContext.nodeOutnode().size(); i++)
{
wdContext.nodeOutnode().setLeadSelection(i);
if (wdContext.currentOutnodeElement().getFieldValue()==1)
{
IPrivateExampleView.ISourceTable1Element Source1Element =
wdContext.createSourceTable1Element();
Source1Element.setFieldValue(1);
wdContext.nodeSourceTable1().addElement(Source1Element);
}
else
{
IPrivateExampleView.ISourceTable2Element Source2Element =
wdContext.createSourceTable2Element();
Source2Element.setFieldValue(2);
wdContext.nodeSourceTable2().addElement(Source2Element);
}
}
Regards.
Julio Herrera
Edited by: Julio Cesar Herrera on Jan 3, 2008 7:15 PM
Yay, just learned to use blocks and corrected this post
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.