cancel
Showing results for 
Search instead for 
Did you mean: 

Add child node to a node dynamically at runtime

Former Member
0 Kudos

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();

}

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Armin,

Thanx for the reply.Mine is a non-singleton node .

Regards

swathi

Answers (0)