cancel
Showing results for 
Search instead for 
Did you mean: 

Value of attribute not copied after WDCopyService.copyElements

Former Member
0 Kudos

Hi,

I am trying to copy values from the cutom controller context to the view controller using WDCopyService.copyElements(srcNode, destNode).

I can see the values in the custom controller in debug mode.

But some the attribute values are not present in the view controller after doing

WDCopyService.copyElements

I would need your expert advice.

Thanks

Asif

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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).

Please check if your contexts nodes have the same sets of attributes.

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks Dimitri and Rajit,

I just recreated the attribute and it worked i guess there was some generation problem of the WD classes.

Former Member
0 Kudos

Hi Rajit,

I want to avoid doing that as i am creating new value attributes in the view and if i map it i wont be allowed to make new value attributes.

Former Member
0 Kudos

Hi,

Then check the types of the attributes in view context & controller context. They must be the same for WDCopyService to work.

copyElements works only if you have both nodes bound to same structure/class (meaning same number of attributes)

copyCorresponding compares the attribute names & their types (types should be compatible) and do this in a loop for every element.

Since your node in the view has a different structure to context's node, may be u shud use copyCorresponding. As said earlier, check the attribute types.

Thanks,

Rajit

Message was edited by:

Rajit Srinivas

Former Member
0 Kudos

Hi

Do a context mapping from Controller context to View context.

Thanks,

Rajit