cancel
Showing results for 
Search instead for 
Did you mean: 

copying values from one value node to another

Former Member
0 Kudos

Hi,

I have two value nodes Ctx_vn_Skills_Copy and Ctx_vn_ProjectDetails.I want to copy the value of value attribute 'SkillID' from Ctx_vn_Skills_Copy to Ctx_vn_ProjectDetails. For that i have used the following code.I get the value skillID of Ctx_vn_Skills_Copy right but for SkillID of Ctx_vn_ProjectDetails i get a null value.Where am i doing wrong??..and if i want to select multiple values of skillID from Ctx_vn_Skills_Copy selected and copied to Ctx_vn_ProjectDetails, then what should be the change in my code??

public void savedata( )

{

String skill_id ="";

IPublicTdc_UICust.ICtx_vn_Skills_CopyNode copynode = wdContext.nodeCtx_vn_Skills_Copy();

IPublicTdc_UICust.ICtx_vn_Skills_CopyElement copyelement = null;

for(int i=0;i<copynode.size();i++)

{

copyelement = copynode.getCtx_vn_Skills_CopyElementAt(i);

skill_id = wdContext.currentCtx_vn_Skills_CopyElement().getSkillID();

}

wdComponentAPI.getMessageManager().reportSuccess(""+ skill_id );

wdComponentAPI.getMessageManager().reportSuccess("success");

IPublicTdc_UICust.ICtx_vn_ProjectDetailsNode prodetnode = wdContext.nodeCtx_vn_ProjectDetails();

IPublicTdc_UICust.ICtx_vn_ProjectDetailsElement prodetele = null;

for(int i=0;i<prodetnode.size();i++)

{

copyelement = copynode.createCtx_vn_Skills_CopyElement();

prodetele = prodetnode.currentCtx_vn_ProjectDetailsElement();

prodetele.setCtx_va_skillid(copyelement.getSkillID());

}

wdComponentAPI.getMessageManager().reportSuccess("SKILLID"+ wdContext.currentCtx_vn_ProjectDetailsElement().getCtx_va_skillid());

//@@end

}

Accepted Solutions (1)

Accepted Solutions (1)

former_member192434
Active Contributor
0 Kudos

Hi

use this

wdCopyService.copyElements(wdContext.node<ModelNodeName>,wdContext.node<ValueNodeName>);

Thanks

Former Member
0 Kudos

Hi,

I used the copyservice method but it didnt help.The number of value attributes in both the nodes is not the same.

former_member192434
Active Contributor
0 Kudos

Hi Parama,

i would sugget you to create same no of "value attributes" and set the type equal types. and the apply

WdCopyService() method. ,

otherwise you have to follow long process.

by iterateing thru node and then getting attribute value and then once again putting that value to another node attribute value.

Thanks

Answers (0)