on 01-10-2008 5:42 AM
hi,
i hv created a table dynamically.
i want to add entries to it.
bt it takes only 1 entry .
if i write the 2nd one i get the error:
must not add elements to a Node of cardinality 0..1or 1..1
i hv written the following code:
IWDNodeInfo node=
wdContext.getNodeInfo().addChild(
"TableNode",null,true,true,false,false,false,true,
null,null,null);
IWDAttributeInfo name = node.addAttribute ("Name","ddic:com.sap.dictionary.string");
IWDAttributeInfo add = node.addAttribute("Address","ddic:com.sap.dictionary.string");
IWDNode node1 = wdContext.wdGetAPI().getRootNode().getChildNode("TableNode",IWDNode.LEAD_SELECTION);
IWDNodeElement ne = node1.createElement();
ne.setAttributeValue("Name","Parama");
ne.setAttributeValue("Address","parama.laha@lntinfotech.com");
node1.addElement(ne);
how do i set the cardinality of node to 0:n,
so that i can enter multiple values into my table?
plz help.
thanx.
regards,
ankita
Hi,
Try this:
IWDNodeInfo node = wdContext.getNodeInfo().addChild("TableNode",
null,
true, //singleton
false, //mandatory, setting this to true sets the min. cardinality to 1
true, //multiple, setting this to true sets the max. cardinality to n
false,
false,
true,
null,
null,
null
);
//Now the cardinality of the created value node is 0...n
// The rest of the code remains same...
Regards,
Satyajit.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.