on 12-04-2009 3:51 PM
Hi everybody,
how can i fill values of a subnode within a model node?
I try it with the following piece of code but without success:
Node:
- ModelNode
--- ModelSubnode
-
val1
-
val2
ModelNode modelNode= new ModelNode(WDModelScopeType.TASK_SCOPE);
ModelSubnode modelSubnode= new ModelSubnode ();
modelSubnode.setVal1("1");
modelSubnode.setVal1("2");
modelNode.addModelNode(modelSubnode);
wdContext.nodeModelNode().bind( modelNode );
regards,
Sid
Edited by: Sid on Dec 4, 2009 5:05 PM
Edited by: Sid on Dec 5, 2009 9:57 AM
Hi Friend,
I think You should use the modelNode.setModelNode(modelSubnode); instead of modelNode.addModelNode(modelSubnode);
try this.
ModelNode modelNode= new ModelNode(WDModelScopeType.TASK_SCOPE);
ModelSubnode modelSubnode= new ModelSubnode ();
modelSubnode.setVal1("1");
modelSubnode.setVal1("2");
modelNode.setModelNode(modelSubnode); // instead of modelNode.addModelNode(modelSubnode);
wdContext.nodeModelNode().bind( modelNode );
please let us know if still problem persist.
Regards
Jeetendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi friend,
If the set method is of abstract list type then i think you should go like this.
ModelNode modelNode= new ModelNode(WDModelScopeType.TASK_SCOPE);
List<modeSublNode> subModelList = new ArrayList<ModeSublNode>();
ModelSubnode modelSubnode= new ModelSubnode ();
for(i=0;i<wdContext.node<TheNodeFromWheretheDatahasToBeCopied>().size;i++){
modelSubnode.setVal1("1");
modelSubnode.setVal1("2");
subModelList.add(modelSubNode);
}
modelNode.setModelNode(subModelList);
wdContext.nodeModelNode().bind( modelNode );
Although i didn't properly get that what you mean by the set<> method is of abstract List type. If it expect List then you should pass the List to it. Or please provide a little more detail. so that your problem can be solved.
Regards
Jeetendra
User | Count |
---|---|
83 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.