on 05-16-2008 7:52 AM
hi
i have model called IT_XXX and
and i have a value node calles IT_YY
and i have created all the context attributes of the
model similarly in the valuenode
now i want to copy value node in to model node
but when i write
WDCOPYService(wdcontext.nodeIT_XX,wdcontext.nodeIt_yy)
and in the next step i have called the RFC mode
its showing error for the wdcopyservice as
wdcopyservice is not application for view .
scenario as soon as soon i click the button table should get populate
can any one help me ?
hi
You have model node right. Click that model and from the properties note the structure.
Then destination node right click and select structure binding and select the structure that you had previously noted. So that all the attributes will be created under the destination node with the same name and data type.
Now in coding part wdCopyService.copyElements((IWDNode)<Model Node>,(IWDNode)<DestinatiuonNode>)
Regards
Chandran S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
while making use of copy service,you need to make sure of following things:
1. Structure of model node and value nodeis exactly same.
2. Attribute name in model node and value node is same.
3. CopySercvice is used as:
wdCopyService.copyElements(model node,data node);
4. Copy service is used only after executing the RFC.
5. Moreover copy service has one morelimitation.It can copy elements from model node to value node.Reverse is not possible.
regards,
amit bagati
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kishore,
If the cardinality of the nodes is 0..n, use the following code :
for(int i=0; i<wdContext.nodeIT_XXX().size(); i++)
WDCopyService.copyCorresponding
(wdContext.nodeIT_YY().getIT_YYElementAt(i), wdContext.nodeIT_XXX).getIT_XXXElementAt(i));
If the cardinality of the nodes are 1..1, use the following code :
WDCopyService.copyCorresponding(wdContext.currentIT_YYElement(), wdContext.currentIT_XXXElement());
Regards,
Sayan Ghosh
Edited by: sayan ghosh on May 16, 2008 4:47 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Its not the way you have written. Its like this:
WDCopyService.copySubtree(sourceNode, destNode);
Please do organize imports if it does not recognize the WDCopyService.
Please check the docs for other methods of the WDCopyService.
Hope this helps.
thanks & regards,
Manoj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kishore,
The method WDCopyService.copyElements copies only those attributes from "source" which are present in "target" and if they match (the names equal case-sensitive and the types are compatible).
and your contexts nodes have the same sets of attributes.
Thanks n Regards,
Jhansi Miryala
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.