on 10-27-2010 9:53 AM
Hello Everyone,
I have to copy values from Context Value Node to Model Node (i.e. V_Node to M_Node) . I am using the following code:
WDCopyService.copyElements(wdContext.nodeV_Node(), wdContext.nodeM_Node());
it is giving me runtime error:
com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: nodes are incompatible
But I have no problem to use this WDCopyService.copyElements to copy values from Model Node to Value Node as below:
WDCopyService.copyElements(wdContext.nodeM_Node(), wdContext.nodeV_Node());
Could anyone please tell me why and how to resolve the iseue.
Thanks alot, Jin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Jin,
To use copy service API, u need to satisfy 2 condition for the attributes of source node and target node:
1. The name of the attribute should be same (including the case of the name)- Abc is different from ABC
2. Type of the attribute should also be the same.
copy elements works for copying values from Model node to context and does not work vice-versa. To enable the copying of context node to model node, use copycorresponding API.
Eg:
int contextNodeSize = wdContext().node<contextNodeName>().size();
for(int i = 0; i < contextNodeSize; i++)
{
<modelNodeName> modelObject = new <modelNodeName>();
<contextNodeName>Element contextObject = wdContext().node<contextNodeName>().get<contextNodeName>ElementAt(i);
WDCopyService.copyCorresponding(contextObject, modelObject);
}
This will copy the values from Context Node to Model Node.
Hope this helps you.
Regards,
Poojith MV
Dear Jin,
By using the Copy Service, you can not copy the data from Value Node to Model Node.
Cheers!!!
Umang
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.
Hi,
Just go through the Java doc for its API, it will answer your question.
Here is the [Link|http://help.sap.com/javadocs/NW04S/SPS09/wd/com/sap/tc/webdynpro/progmodel/api/WDCopyService.html#copyElements(com.sap.tc.webdynpro.progmodel.api.IWDNode, com.sap.tc.webdynpro.progmodel.api.IWDNode)]
Hope it helps.
Regards,
Manoj
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.