on 02-07-2007 6:58 AM
i have a table ....which i populate my table with the model node....
when i put this code i get an incompatible node exception
wdContext.currentContextElement().getTableFilter().filter(wdEvent,wdContext.nodeProductCommandBean wdContext.nodeProduct(),wdContext.nodeVnFilters());
copy model node to value node will result in incompatible node...
wat is the solution for this....
for instance when using table filter
wdContext.currentContextElement().getTableFilter().filter(wdEvent,wdContext.nodeProductCommandBean wdContext.nodeProduct(),wdContext.nodeVnFilters());
Message was edited by:
yzme yzme
Hi,
I Have faced the similar situation before, where i have to copy some of the model node values to value node structure. And since both structures are different you cannot use the copy service.
What you can code is loop over the model node , fetch the values ...then create the value node elements and keep addign them to a java.util.List. And at last bind that list to your value node.
Code Should Look Like this
java.util.List lst = wdContext.current<ModelNode>Element().modelObject().get<Model>Response_Sync().get<ListOfElements>();
java.util.List newList = new java.util.ArrayList();
IPublic<Component>.I<ValueNode>Element sData = null;
for (int i =0; i < lst.size(); i++){
sData = wdContext.create<ValueNode>Element();
com.sap.model.so007qr.<ModelNode> so = (com.sap.model.so007qr.<ModelNode>)lst.get(i);
sData.setAttributeOne(so.getAttributeOne());
sData.setAttributeTwo(so.getAttributeTwo());
sData.setAttributeThree(so.getAttributeThree());
newList.add(sData);
}
wdContext.nodeSalesData().bind(newList);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I'm doing that with:
//IT WORKS
WDCopyService.copySubtree((IWDNode)ModelNode,(IWDNode)ValueNode);
It works fine but it doesn't work in the reverse manner:
//IT DOESN'T WORK
WDCopyService.copySubtree((IWDNode)ValueNode,(IWDNode)ModelNode);
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
actually i am iterating the node
int size = wdContext.node<modelnodename>.size();
IPrivate<viewname>.I<Valuenodename>Element ele;
for(int i =0;i<size;i++
{
ele = wdContext.create<valuenodename>element();
ele.setname(wdContext.node<modelnodename>.get<modelnodename>elementat(i).getname();
ele.setPrive(wdContext.node<modelnodename>.get<modelnodename>elementat(i).getprice();
wdContext.node<valuenodename>.addelement(ele);
}
though copysubtree is a good idea..i will try...
Can u explain what is the exact error you are getting ?
Copying data from model node to value node will not cause any error if they share same structure.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
try out this.
int size = wdContext.node<modelnodename>.size();
IPrivate<viewname>.I<Valuenodename>Element ele;
for(int i =0;i<size;i++
{
ele = wdContext.create<valuenodename>element();
ele.setname(wdContext.node<modelnodename>.get<modelnodename>elementat(i).getname();
ele.setPrive(wdContext.node<modelnodename>.get<modelnodename>elementat(i).getprice();
wdContext.node<valuenodename>.addelement(ele);
}
Try out this code.
Regards,
Gopi
Hi,
If both the model and value node are of the same structure. Then you can use
WDCopyService.copy........();
function to transfer the data in one shot.
Regards,
Mahesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
please, describe in more details: what do you mean "copy model node to value node", and "incompatible node".
clear question is half of an answer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.