on 10-08-2009 7:50 AM
Hi,
Iam creating a table popin with a table inside.
I have the main node called tablehealthplans with cardinality 0..n and selection 0..1.
I have a child node under the above parent node called tabledependents.
Iam filling the tablehealthplans at runtime dynamically and iam trying to do the same with the tabledependents node .
When i try to add the values related to the dependents for the node tabledependents for that particular plan it adds the same value to all the three rows of the parent node.
Can anyone guide me on how to add the values to a child node of a parent node at runtime.
Below is my code.
wdContext.nodeTablehealthplans().addElement(2,objElement);
wdContext.nodeGET_ENROLLED_DEPENDENTS().moveFirst();
IPrivateGetBenefitsOverview.ITabledependentsElement dependents;
for(int j = 0; j < wdContext.nodeGET_ENROLLED_DEPENDENTS().size();j++)
{
dependents = wdContext.createTabledependentsElement();
dependents.setDep_Name(wdContext.nodeGET_ENROLLED_DEPENDENTS().getGET_ENROLLED_DEPENDENTSElementAt(j).getDep_Name());
((IPrivateGetBenefitsOverview.ITablehealthplansNode)objElement.node()).nodeTabledependents().addElement(dependents);
wdContext.nodeGET_ENROLLED_DEPENDENTS().moveNext();
}
The thread title is misleading, seems you want to add child node elements to a parent node element.
There are two cases:
- child node is singleton (more effcient, child node exists only for lead-selected parent node element)
- child node in non-singleton (child node exists for each parent node element, needed for example if a Tree UI element is used)
In the singleton-case: Implement a supply function for the child node. The supply function will have a parameter "parentElement" which will be the parent node element to which the child entries to be created belong.
In the non-singleton case you can access the child node that belongs to a parent node element as
parentElement.node<ChildNode>()
But it would be important to know your use-case better to give the right solution.
Armin
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 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
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.