on 05-26-2008 10:35 AM
Hi,
i want to pass output of the one model contex attribute to another model context attribute input.
>Test1ModelNodeInput
> OutputNode1
> Node1
--Attr1(output model attribute)
>Test2ModelNodeInput
>OutputNode2
--Attr2(input model attribute)
Regards
Anumit
try WDCopyService.copyCorresponding over a "for" loop
WDCopyService.copyCorresponding(wdContext.node1().current1Element(),
wdContext.2().nodeInput_Zcmdbsystem().current2Element());
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi u can use Copy service
WDCopyService.copyElements(wdContext.nodeSourceNode(),wdContext.nodeTargetNode());
But make sure that ur both nodes are identical in structure.
for this you should also use the following import statment in the Beginning.
import com.sap.tc.webdynpro.progmodel.api.WDCopyService
Rewards points if helpful
regards
Surender Dahiya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anumit,
To copy data from master node to target node
try
{
IPrivateDialogView.ITargetNode TargetNode = wdContext.nodeTarget();
IPrivateDialogView. IMasterNode masterNode = wdContext.nodeMaster();
int size = masterNode.size();
for (int i = 0; i < size; i++)
{
IPrivateDialogView. IMasterElement masterElement = (IPrivateDialogView. IMasterElement)wdContext.nodeMaster ().getElementAt(i);
IPrivateDialogView.ITargetNode node = wdContext.nodeTarget();
IPrivateDialogView.ITargetElement element = node.createTargetElement();
WDCopyService.copyCorresponding(masterElement, element);
node.addElement(element);
}
}
catch(Exception e)
{
e.printStackTrace();
}
or you can use this code also
try{
WDCopyService.copyElements(wdContext.nodeMaster(),wdContext.nodeTarget());
}
catch(Exception e)
{
e.printStackTrace();
}
Regards,
Mithu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi,
for this get value from output node by get method and set this value in input field of another attribute by set method.
wdContext.currentContextElement().setAttribute1(wdContext.currentContextElement().getAttribute2());
Regards
Trilochan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.