on 09-10-2007 10:38 PM
Hi,
I am constructing a context with each sub node having many sub nodes.
In the simplest case I am take upto a three levels - a parent node with child node which in turn has child attributes.
The problem is that , I am not getting the right syntax to instantiate / bind these nodes.
I get the error that it is not possible to bind child node when parent node is not instantiated.
The Context is as follows
recordtable -> recordrow->rowc1,rowc2
c1 and c2 are the attributes of the node recordrow which is assigned to node recordtable
The error code is as below
<b><i>IPrivateAdobetableformView.IRecordtableElement tabelem = wdContext.createRecordtableElement();
Collection col = new ArrayList();
col.clear();
IPrivateAdobetableformView.IRecordrowElement element = wdContext.createRecordrowElement();
element.setRowc1("col1");
element.setRowc2("col2");
// col.add(element);
Collection tabcol = new ArrayList();
tabcol.add(element);
IPrivateAdobetableformView.IRecordrowElement element2 = wdContext.createRecordrowElement();
element2.setRowc1("col3");
element2.setRowc2("col4");
// col.add(element);
tabcol.add(element2);
tabelem.setCol1("x");
tabelem.setCol2("y");
Collection col2 = new ArrayList();
col2.add(tabelem);
col2.add(tabcol);
wdContext.nodeRecordrow().bind(tabcol); </i></b>
-
Basically I am constructing a kind of 3 dimensional table.
Hi Harish,
Just add the line in bold in your code because you are only binding the child node element to its node and have forgot to bind parent node element to its node.
IPrivateAdobetableformView.IRecordtableElement tabelem = wdContext.createRecordtableElement();
Collection col = new ArrayList();
col.clear();
IPrivateAdobetableformView.IRecordrowElement element = wdContext.createRecordrowElement();
element.setRowc1("col1");
element.setRowc2("col2");
// col.add(element);
Collection tabcol = new ArrayList();
tabcol.add(element);
IPrivateAdobetableformView.IRecordrowElement element2 = wdContext.createRecordrowElement();
element2.setRowc1("col3");
element2.setRowc2("col4");
// col.add(element);
tabcol.add(element2);
tabelem.setCol1("x");
tabelem.setCol2("y");
Collection col2 = new ArrayList();
col2.add(tabelem);
col2.add(tabcol);
<b>wdContext.nodeRecordtable().bind(tabelem);</b>
wdContext.nodeRecordrow().bind(tabcol);
Regards,
Murtuza
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
7 | |
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.