on 06-03-2005 5:08 PM
Hi,
Need to create singleton node elements at runtime. At design time I have defined NodeB as child of NodeA. NodeB is singleton, and as such I dont get the typed access code to create elements of NodeB using code as shown below.
IPrivateProjectManagerView.IPlantsElement plantsElement = wdContext.createPlantsElement();
plantsElement.setName(currentPlant);
wdContext.nodePlants().addElement(plantsElement);
//Add current plant to the Plants node
IPrivateProjectManagerView.IPlantNode plantNode = plantsElement.nodePlant();
IPrivateProjectManagerView.IPlantElement plantElement = plantNode.createPlantElement();
//plantElement.setName(currentPlant);
plantNode.addElement(plantElement);
//add Avail Check field to current plant
IPrivateProjectManagerView.IAvailCheckNode availCheckNode = plantElement.nodeAvailCheck();
IPrivateProjectManagerView.IAvailCheckElement availCheckElement = availCheckNode.createAvailCheckElement();
availCheckNode.addElement(availCheckElement);
IPrivateProjectManagerView.IAvailCheckSetNode availCheckSetNode = availCheckElement.nodeAvailCheckSet();
IPrivateProjectManagerView.IAvailCheckSetElement availCheckSetElement = availCheckSetNode.createAvailCheckSetElement();
availCheckSetNode.addElement(availCheckSetElement);
In the above case AvailCheck is non-singleton child node.
Do let me know what the code is for creating node element NodeB, and its child node element say NodeB1.
Thanks !
Sri
> Hi,
>
> Need to create singleton node elements at runtime. At
> design time I have defined NodeB as child of NodeA.
> NodeB is singleton, and as such I dont get the typed
> access code to create elements of NodeB using code as
> shown below.
Generation of the typed context interface has nothing to do with the singleton property of a node.
For a singleton child node, there does not exist a separate node instance per parent <b>element</b>, so you do not get methods of the form parentElement.node.createElement() but only wdContext.createElement().
Armin
Message was edited by: Armin Reichert
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Armin,
I understand that there is not connection between typed context interface and singleton property of nodee.
The scenario I am trying to resolve is as follows.
The context structure at design is as follows.
NodePlants (singleton, 0:n)
-
NodePlant (non-singleton,0:n)
****---NodeField1 (non-singleton,0:n)
****---NodeField2 (singleton,0:n)
Application can have multiple elements of NodePlant ( 1000,1001 etc.), and each plant element has its own set of NodeField1, NodeField2 elements. I can create NodeField1 elements at runtime, for each plant, using the typed access code parentElement.node.createElement(). But, not for NodeField2 as its a singleton node.
Reason NodeField2 is singleton, is because, thats the only way I have been able to bind dropdown lists to
Armin,
I understand that there is not connection between typed context interface and singleton property of nodee.
The scenario I am trying to resolve is as follows.
The context structure at design is as follows.
NodePlants (singleton, 0:n)
-
NodePlant (non-singleton,0:n)
****---NodeField1 (non-singleton,0:n)
****---NodeField2 (singleton,0:n)
Application can have multiple elements of NodePlant ( 1000,1001 etc.), and each plant element has its own set of NodeField1, NodeField2 elements. I can create NodeField1 elements at runtime, for each plant, using the typed access code parentElement.node.createElement(). But, not for NodeField2 as its a singleton node.
Reason NodeField2 is singleton, is because, thats the only way I have been able to bind dropdown lists to context nodes or else code will error out.
Do let me know the best approach to resolve this.
Thanks !
SP
I tried working on your scenario and found that inorder to create an element for the NodeField2 node you need to create an element for all its parent nodes.
IPrivate<viewname>.INodePlantsElement testElem=wdContext.createNodePlantsElement();
wdContext.nodeNodePlants().bind(testElem);
IPrivate<viewname>.INodePlantElement elem=wdContext.createNodePlantElement();
wdContext.nodeNodePlant().bind(elem);
IPrivateNodeAppView.INodeField2Element ele=wdContext.createNodeField2Element();
wdContext.nodeNodeField2().bind(ele);
Regards
Noufal
IPrivateSdnAppView.IVnNodeElement neEmp =wdContext.createVnNodeElement();
neEmp.set....
wdContext.nodeVnNode().addElement(neEmp);
IPrivateSdnAppView.IVnChildElement neDet = wdContext.createVnChildElement();
neDet.setVaName("Text"+i);
neEmp.nodeVnChild().bind(neDet);
Here NodeVnChild is the Child Node of VNNode and VnChild is Singleton False
Here i am adding the element to the child node with the help pf object of parent node. This is POssible incaso of only the child node is made as singleton false
Is this what u were asking
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.