on 03-11-2009 9:40 AM
I tried to do this:
WDCopyService.copyElements(wdContext.nodeResponse25(), wdContext.nodeHeader2());
However it gives the error:
"Node(DemoWSViewSearchOrder.Order.Header2): cannot bind or add elements because the node has no valid parent"
So I initiate the node with this:
IPrivateDemoWSViewSearchOrder.IHeader2Element ele2 =
wdContext.nodeHeader2().createHeader2Element();
wdContext.nodeHeader2().addElement(ele2);
However it is still giving the error:
"Node(DemoWSViewSearchOrder.Order.Header2): cannot bind or add elements because the node has no valid parent"
Any idea why?
Hi
As you said :I initiate the node with this?
To get facility of WDCopyService no need to initiate any node belongs to model .Only care need to take is
Use this method after execution of the model after executing and invalidating the response node of model,
updated data is there. now u can either bind it to any table or copy it to another node using WDCopyService.
Regarding this error
Node(DemoWSViewSearchOrder.Order.Header2): cannot bind or add elements because the node has no valid parent
It need a identification of Source (which contain the updated data after executing the model), and target (where u want copy of this data)
read this carefully
@throws RuntimeException if target is a model node and
* source is not a model node holding the same class.
Best Regards
Satish Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi there..
I have successfully COPIEd from Model Node (output) to Value node.
Now I am trying to copy them into the input node of another model with same structure.. Any advise on that? When I tried to use wdCopyService, it say nodes are incompatible..
Does that means I must do 1 attribute b y 1 attribute when copying over?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
Sorry to mentioned it before that : for use of WDCopyService signature of the nodes should be same.
Again u are doing mistake here that providing a input to a model node and u are using CopyService ,
Please understand the context of uses of this standard method ,not at all related to give input to model node.
Simplest is get the value form and set it to model node.(too many thing r there before executing the model that validation ,null pointer check. How u will achieve this by using copyService and it may u r not doing these kind of operation in your implementation ,Even then avoid this kind of uses there)
Best Regards
Satish Kumar
Hi Jackson,
Did you initialize the node Order?
and I guess you must have initialized the node DemoWSViewSearchOrder.
In fact, you need to initialize entire tree of the node Order up to top level node.
If you have done the same, please let me know the error stack, node structure and what you are trying to do.
Regards,
Siva
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi there,
I tried to Model Node initiate with this:
Sa_Display_Header tmp = new Sa_Display_Header(model);
IPrivateDemoWSViewSearchOrder.ISa_Display_HeaderElement ele =
wdContext.nodeSa_Display_Header().createSa_Display_HeaderElement(tmp);
wdContext.nodeSa_Display_Header().addElement(ele);
But it says:
com.sap.tc.webdynpro.progmodel.context.ContextException: Node(DemoWSViewSearchOrder.Request_Sa_Display_Header.Sa_Display_Header): must not add elements to a Node of cardinality 0..1 or 1..1
How can I initiate a 0..1 or 1..1 model node?
Hi Jackson,
WDCopyService.copyElements(wdContext.nodeResponse25(), wdContext.nodeHeader2());
here nodeResponse25() is the model node and Header2 is the value node, right ?.
wdCopyservices will not work for this, instead give the valid model node which is the sub node of response node. for eg :
if ur node structure is :
Response - model node
responseMsg - model node
Output - model node
Name - model attribute.
and ur value node structure is :
Header - value node
Name - value attribute
then use WDCopyService.copyElements(wdContext.nodeOutput, wdContext.nodeHeader());
Note : for using the WDCopyservices , the two nodes should have same Structure (attributes with same type and ensure that even cardinality matches).
Thanks and Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you. Yes I am already using the immediate node above the element.
if ur VALUE node structure is :
Response - model node
responseMsg - model node
Output - model node
Name - model attribute.
I have to initiate all the respective node is that the case? I can't just initiate the top most node or the node that I am using?
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.