on 05-07-2009 6:33 PM
Hi experts,
Does anyone have sample code about 1) adding a new node to the root context, 2) give it a name and 3) referring to this newly created node with the conetxt path?
Thanks
btw, could you provide the link for the javadoc?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Armin,
I am trying to do this and keep getting erro about incompatible class:
wdContext.getNodeInfo().addChild("DynamicNode",
mymodel.class,
true,
CMICardinality.ONE,
CMICardinality.ZERO_TO_ONE,
true,
wdContext.getContext().getStructure("com.my.structure") );
IWDNode node = wdContext.getChildNode("DynamicNode", 0);
IWDNodeElement e = node.createElement(an_instance_of mymodelObject());
node.addElement(e);
Can I do it this way?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If I have an existing object, say an instance of a "User" class. Can I just bind this instance to this node?
Thanks for providing the links.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
So I can bind this node to any object at run time?
Thanks again Armin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Armin,
Do I need to specify the class when creating this new node?
addChild("DynamicNode",
null, // CLASS NAME
true,
CMICardinality.ONE, /* at least one and not multiple = 1:1 */
CMICardinality.ZERO_TO_ONE, /* no lower bound and not multiple = 0:1 */
true, null);
If it is added to the root, can I then refer it using the context path as "DynamicNode" just like those nodes created at design time?
Thanks again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.