on 02-22-2006 1:23 PM
Hi folks!
i'm trying to create a navigation link between an at runtime created outboundplug, and an inboundplug from a interfaceView.
I got: <b>srcViewUsage.createNavigationTarget(stepPlug.getName(),targetViewUsage,inplug.getName());</b>
But this gives an error:
<b>java.lang.NullPointerException: Can't set a relation role because o==null and the role cardinality is 1.
at com.sap.tc.webdynpro.repository.RepositoryObject.setRelatedModelObject(RepositoryObject.java:525)
at com.sap.tc.webdynpro.progmodel.repository.IWDNavigationTargetReferenceInfo$Implementation.setTargetInternal(IWDNavigationTargetReferenceInfo.java:171)
at com.sap.tc.webdynpro.progmodel.repository.IWDViewUsageInfo$Implementation.createNavigationTarget(IWDViewUsageInfo.java:780)
at com.flexso.test.roadbody.Start.createStepPlug(Start.java:226)
at com.flexso.test.roadbody.wdp.InternalStart.createStepPlug(InternalStart.java:148)
at com.flexso.test.roadbody.Start.wdDoModifyView(Start.java:150)</b>
any ideas?
thx in advance
Hi Kristof,
Some sources
[code]
//IWDViewUsageInfo$Implementation.createNavigationTarget
public com.sap.tc.webdynpro.progmodel.repository.IWDNavigationTargetReferenceInfo createNavigationTarget( java.lang.String sourcePlugName, com.sap.tc.webdynpro.progmodel.repository.IWDViewUsageInfo targetViewUsage, java.lang.String targetPlugName ) {
.......
// inbound plug of the target view
IWDInboundPlugInfo.IFramework targetInboundPlugInfo =
(IWDInboundPlugInfo.IFramework)((IWDAbstractViewInfo.IFramework) targetViewUsage.getView()).findInInboundPlugs(targetPlugName);
.........
navigationTargetReferenceInfo.setTargetInternal(targetInboundPlugInfo);//Line 780
//IWDNavigationTargetReferenceInfo$Implementation.setTargetInternal
public void setTargetInternal(com.sap.tc.webdynpro.progmodel.repository.IWDInboundPlugInfo.IFramework value) {
setRelatedModelObject("Target", (com.sap.tc.webdynpro.repository.api.IWDRepositoryModelClass)value);//Line 171
}
//RepositoryObject.setRelatedModelObject
public void setRelatedModelObject(String rolename, ICMIModelClass o) {
.....
CMICardinality rolecard = associatedModelClassInfo().getTargetRoleInfo(rolename).getCardinality();
if(o == null && rolecard.isMandatory())
throw new NullPointerException("Can't set a relation role because o==null and the role cardinality is 1.");//525
......
[/code]
So, seems like you are passing name of non existing inbound plug ( inplug.getName() ).
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.
Yes, in a way, you were right. I was using the wrong targetViewUsage. I solved it now.
Thx for your quick answer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all,
unfortunately I am the same error message as steted above (java.lang.NullPointerException: Can't set a relation role because o==null and the role cardinality is 1.)
Could anybody please post, how this issue has been solved? Seems to be an issue with the targetViewUsage. Probably someone could post a code snippet?
Thank you and kind regards, Patrick.
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.