<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Populating a context in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/populating-a-context/qaa-p/985592#M375760</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is NodeB a singleton or a non-singleton?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is a non-singleton, every element of NodeA has its own instance of a NodeB which can be accessed using&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
NodeAElement a = ...;
NodeBElement b = a.nodeB().createNodeBElement();
a.nodeB().addElement(b);
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Armin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Jul 2005 20:14:05 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-07-25T20:14:05Z</dc:date>
    <item>
      <title>Populating a context</title>
      <link>https://community.sap.com/t5/technology-q-a/populating-a-context/qaq-p/985590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've search the forum, but haven't found anything to address this issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a context of&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
NodeA
  |-- NodeB
  |   |-- ValueA
  |   |-- ValueB
  |   |-- ValueC
  |--ValueD
  |--ValueE&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have 1-N of NodeA with it containing 1-N NodeB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to prepopulate the context on startup but can't get NodeB inserted into NodeA. I.e. my code looks like this&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;wdContext.nodeNodeA().invalidate();
for (int k = 0; k &amp;lt; 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 &amp;lt; outStrs.length; j++) {
	nodeB.setValueA(outStrs[j][0]);
	nodeB.setValueB(outStrs[j][1]);
	nodeB.setValueC(outStrs[j][2]);
    }
   wdContext.nodeNodeA().addElement(nodeA);
}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;How do I get the 1-N nodes of NodeB associated with NodeA?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;&lt;P&gt;Lori&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2005 19:57:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/populating-a-context/qaq-p/985590</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-25T19:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a context</title>
      <link>https://community.sap.com/t5/technology-q-a/populating-a-context/qaa-p/985591#M375759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lori&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IPrivateCommentsView.INode_AElement nodeA = null;&lt;/P&gt;&lt;P&gt;    nodeA = wdContext.nodeNode_A().createNode_AElement();&lt;/P&gt;&lt;P&gt;    wdContext.nodeNode_A().addElement(nodeA);&lt;/P&gt;&lt;P&gt;	IPrivateCommentsView.INode_BElement nodeB = wdContext.nodeNode_A().nodeNode_B().createNode_BElement();&lt;/P&gt;&lt;P&gt;    wdContext.nodeNode_B().addElement(nodeB);&lt;/P&gt;&lt;P&gt;    nodeB.setAtt1("xyz");&lt;/P&gt;&lt;P&gt;    nodeB.setAtt2("ABC");&lt;/P&gt;&lt;P&gt;    nodeA.setAtt_A("Node A");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;NagaKishore V&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2005 20:12:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/populating-a-context/qaa-p/985591#M375759</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-25T20:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a context</title>
      <link>https://community.sap.com/t5/technology-q-a/populating-a-context/qaa-p/985592#M375760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is NodeB a singleton or a non-singleton?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is a non-singleton, every element of NodeA has its own instance of a NodeB which can be accessed using&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
NodeAElement a = ...;
NodeBElement b = a.nodeB().createNodeBElement();
a.nodeB().addElement(b);
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Armin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2005 20:14:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/populating-a-context/qaa-p/985592#M375760</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-25T20:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a context</title>
      <link>https://community.sap.com/t5/technology-q-a/populating-a-context/qaa-p/985593#M375761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;NodeB is a non-singleton (by your description). NodeA can contain 1-N NodeBs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to follow your code but when I type 'a.nodeB()' I get an error. WebDynPro reports that that method does not exist.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2005 20:21:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/populating-a-context/qaa-p/985593#M375761</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-25T20:21:56Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a context</title>
      <link>https://community.sap.com/t5/technology-q-a/populating-a-context/qaa-p/985594#M375762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you set "typedAccessRequired" to true? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is "a" of type "NodeAElement"?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Armin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2005 20:28:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/populating-a-context/qaa-p/985594#M375762</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-25T20:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a context</title>
      <link>https://community.sap.com/t5/technology-q-a/populating-a-context/qaa-p/985595#M375763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't quite understand your code NagaKishore. I want to added 1-N elements of type NodeB to NodeA. And was 'setAtt_A' a 'setAttribute("NodeA", NodeB)'?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2005 20:28:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/populating-a-context/qaa-p/985595#M375763</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-25T20:28:46Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a context</title>
      <link>https://community.sap.com/t5/technology-q-a/populating-a-context/qaa-p/985596#M375764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The typeAccessRequired was set to true.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BUT! I'd forgotten to change the selection (0..1-&amp;gt;1..N) and singleton (true-&amp;gt;false) properties. Now I can access NodeB and modify it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the help!&lt;/P&gt;&lt;P&gt;Lori &amp;lt;*&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Jul 2005 20:33:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/populating-a-context/qaa-p/985596#M375764</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-25T20:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a context</title>
      <link>https://community.sap.com/t5/technology-q-a/populating-a-context/qaa-p/985597#M375765</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hello Lori,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now create the parent element using this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IPrivateView.IAElement pele = wdContext.nodeA().createAElement(); // instead of wdContext.createAElement();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now to add a child node element inside this parent element:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IPrivateView.IBElement cele = pele.nodeB().createBElement();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Piyush.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Jul 2005 06:25:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/populating-a-context/qaa-p/985597#M375765</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-26T06:25:14Z</dc:date>
    </item>
  </channel>
</rss>

