Skip to Content
author's profile photo Former Member
Former Member

Populating a context

I've search the forum, but haven't found anything to address this issue.

I have a context of

  |-- NodeB
  |   |-- ValueA
  |   |-- ValueB
  |   |-- ValueC

I have 1-N of NodeA with it containing 1-N NodeB.

I'm trying to prepopulate the context on startup but can't get NodeB inserted into NodeA. I.e. my code looks like this

for (int k = 0; k < some_info.length; k++) {
    INodeAElement nodeA = wdContext.createNodeAElement();
    nodeA.setValueD((String) some_info[k][0]);
    nodeA.setValueE((String) some_info[k][1]);

    String[][] outStrs = (String[][]) some_info[k][2];
    INodeBElement nodeB = wdContext.createNodeBElement();
    for (int j = 0; j < outStrs.length; j++) {

How do I get the 1-N nodes of NodeB associated with NodeA?

Any help is appreciated.


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 25, 2005 at 08:12 PM

    Hi Lori

    Here is the example

    IPrivateCommentsView.INode_AElement nodeA = null;

    nodeA = wdContext.nodeNode_A().createNode_AElement();


    IPrivateCommentsView.INode_BElement nodeB = wdContext.nodeNode_A().nodeNode_B().createNode_BElement();




    nodeA.setAtt_A("Node A");

    You can loop the above code for n times. Each time you create a node A inside the loop create a node B after Node A in the loop


    NagaKishore V

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 25, 2005 at 08:14 PM

    Is NodeB a singleton or a non-singleton?

    If it is a non-singleton, every element of NodeA has its own instance of a NodeB which can be accessed using

    NodeAElement a = ...;
    NodeBElement b = a.nodeB().createNodeBElement();


    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      hello Lori,

      i think u want to add some child node elements inside a parent node element. similarlly like one school inside which there are many children.

      now create the parent element using this code:

      IPrivateView.IAElement pele = wdContext.nodeA().createAElement(); // instead of wdContext.createAElement();

      now to add a child node element inside this parent element:

      IPrivateView.IBElement cele = pele.nodeB().createBElement();



Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.