on 12-20-2007 2:14 PM
Hi,
I have an onActionAddPersonButtonPressed-Action:
public void onActionAddPersonButtonPressed(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent, com.sap.tc.webdynpro.progmodel.api.IWDNodeElement nodeElement )
{
//@@begin onActionAddPersonButtonPressed(ServerEvent)
wdContext.nodeInjuredPersons().addElement(nodeElement);
//@@end
}
The parameter nodeElement is of type returnFindPerson which belongs to the following Context Node:
RequestFindPerson
---ResponseFindPerson
------returnFindPerson
----
----
I have an other Context Node which are from same type as the Node returnFindPerson:
InjuredPersons
---name
---firstName
If you can see in the code above I want to add the nodeElement to an other Context Node (InjuredPersons).
But I get the following exception:
com.sap.tc.webdynpro.progmodel.context.ContextException: Node(IncRecJcoComp/PersonHitListView.InjuredPersons, class=de.td.increcjcoweb.increcjcoapp.comp.wdp.IPrivatePersonHitListView$IInjuredPersonsNode): cannot bind or add element, because it is already bound to a node
How can I add the parameter nodeElement to InjuredPersons-Node?
Regards,
Armin
Add a new element using createAndAddInjuredPersonsElement() and then either copy the attribute values manually or use WDCopyService.copyCorresponding().
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Armin,
I tried in this way:
IPrivatePersonHitListView.IReturnFindPersonElement returnFindPersonElement = (IPrivatePersonHitListView.IReturnFindPersonElement)nodeElement;
String returnFindName = returnFindPersonElement.mappedReturnFindPersonElement().getName();
wdContext.nodeInjuredPersons().createAndAddInjuredPersonsElement();
WDCopyService.copyCorresponding(wdContext.nodeInjuredPersons().currentInjuredPersonsElement(), returnFindPersonElement);
String injuredPersonsName = wdContext.currentInjuredPersonsElement().getName();
But injuredPersonsName is null and returnFindName is "Mueller".
Are the parameters of method copyCorresponding right?
If I do this wdContext.nodeInjuredPersons().createAndAddInjuredPersonsElement(); and after that I do wdContext.nodeInjuredPersons().currentInjuredPersonsElement(), do I get the new created element?
Regards,
Armin
Hi Armin,
Try this in onActionAddPersonButtonPressed()
{
IPrivate<viewname>.IInjuredPersonsElement ele =
=(IPrivate<viewname>.IInjuredPersonsElement ) nodeElement;
wdContext.nodeInjuredPersons().addElement(ele);
}
regards,
Siva
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.