on 01-31-2006 10:47 AM
Hi,
I'm trying to use the WDCopyService zu copy a contextnode (0..n) to a modelnode (0..n).
WDCopyService.copySubtree( wdContext.nodeMyContext(), wdContext.nodeMyModel() )
All I get at runtime is this:
com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: nodes are incompatible
Both nodes are structure-binded to the structure of the imported model.
Cardinality, attributes and attribute-names are the same.
The contextnode is mapped to the interface-controller and there marked as input-parameter.
Copying this node within the context works. Copying to the model utterly fails.
Any ideas on this?
Thanks in advance.
Alf
Hi,
WDCOpySubTree requires both the nodes to have the same depth and same structure insdie . Or both of them similar in that way.Or they recursive.
In case they are of a single level, try copyCorresponding and check.
And are they value node or model nodes. In case if they are model nodes are they from the sameclass..
Can u give us the complete structure of both the nodes.
Regards
Bharathwaj
Regards
Bharathwaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Alfred,
may i know why u want to copy data from value nodes to model nodes. actually model nodes are used to bind with the model i.e RFC .
Regards,
yashpal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
> Hi Alfred,
> may i know why u want to copy data from
> y data from value nodes to model nodes. actually
> model nodes are used to bind with the model i.e RFC .
>
> Regards,
> yashpal
Hi Yasphal,
I need to modify some user-input to use as model-input values.
My approach was like this:
- view-context -binding-> comp-controller (context-node)
- modify comp-controller (context-node)
- WDCopyService ( context-node; model-node )
- execute model
Seems I have to write the modified input directly into a/the model node ...
Alf
Hi Alf,
From CopyService implementation:
public void copyElements(IWDNode source, IWDNode target)
{
Class sourceClass = ((NodeInfo)source.getNodeInfo()).getElementClass();
Class targetClass = ((NodeInfo)target.getNodeInfo()).getElementClass();
if(targetClass != null && (sourceClass == null || !targetClass.isAssignableFrom(sourceClass)))
throw new WDRuntimeException("nodes are incompatible");
...
}
So, if your target is model, your source MUST be model node (to have assigned element class) AND assignable, which means <i>Determines if the class or interface represented by this Class object is either the same as, or is a superclass or superinterface of, the class or interface represented by the specified Class parameter. It returns true if so; otherwise it returns false. If this Class object represents a primitive type, this method returns true if the specified Class parameter is exactly this Class object; otherwise it returns false. </i>( from http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Class.html ).
Best regards, Maksim Rashchynski.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.