on 06-07-2007 10:30 AM
Hi all,
java.lang.NullPointerException
at com.sap.sh.SHView.wdDoInit(SHView.java:101)
at com.sap.sh.wdp.InternalSHView.wdDoInit(InternalSHView.java:153)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doInit(DelegatingView.java:61)
at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)
at com.sap.tc.webdynpro.progmodel.view.View.initController(View.java:445)
... 32 more
What i missing in this code...
IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute(IPrivateSHView.IJobsElement.JOB);
<b>ISimpleTypeModifiable countryType = attributeInfo.getModifiableSimpleType();</b>(101)
// Set field label and populate valueset
countryType.setFieldLabel("Country");
IModifiableSimpleValueSet valueSet = countryType.getSVServices().getModifiableSimpleValueSet();
for (int i = 0; i < wdContext.nodeJobs_input().size(); i++)
{
valueSet.put(wdContext.nodeJobs_input().getJobs_inputElementAt(i),"cons"+i);
}
Plz Tel me
Thanks & Regards
Mathi
Hi,
Instead of
IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute(IPrivateSHView.IJobsElement.JOB);
use
IWDAttributeInfo attributeInfo = wdContext.getNodeInfo().getAttribute("job");
and then try
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately, most of the given answers are plain wrong.
The problem is: You try to access an attribute named "job" (or a case-variation) of a node named "Jobs". (This follows from the existance of the constant IJobsElement.JOB).
But your code accesses an attribute "job" directly under the context root.
Thus you have to change the expression
wdContext.getNodeInfo().getAttribute(IPrivateSHView.IJobsElement.JOB);
into
wdContext.nodeJobs().getNodeInfo().getAttribute(IPrivateSHView.IJobsElement.JOB);
Armin
HI
Thanks for ypur reply..
I have changed ...but produce this type error...
com.sap.tc.webdynpro.progmodel.context.ContextException: MappedAttributeInfo(SHView.Jobs.Job): must not modify the datatype of a mapped attribute
at com.sap.tc.webdynpro.progmodel.context.MappedAttributeInfo.getModifiableSimpleType(MappedAttributeInfo.java:117)
at com.sap.sh.SHView.wdDoInit(SHView.java:102)
at com.sap.sh.wdp.InternalSHView.wdDoInit(InternalSHView.java:153)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.doInit(DelegatingView.java:61)
at com.sap.tc.webdynpro.progmodel.controller.Controller.initController(Controller.java:215)
... 33 more
See full exception chain for details.
Thanks & regards
Mathi
Hi,
This problem occurs if you execute this in the view controller.
Execute the same code in the component controller you will not have error.
Create a method (say populate) in the component controller and write the code in that.
then add the component controller as the required controller to the view.
In the view controller inside the action (if the values are need after the action) or wdDoInit (if values are needed during loading of the view)
wdThis.wdGetComponentController.populate();
I hope this will solve your problem
after putting the code in the Controller populate method, I am still getting this error <<i>Parse method is not possible for this type</i>>
here is my populate method...
public void Populate( )
{
//@@begin Populate()
IWDAttributeInfo attInfo1 = wdContext.nodeSubmitElements().getNodeInfo().getAttribute(IPrivateDemurrageSubmit.ISubmitElementsElement.INVOICE_DOC);
attInfo1.getModifiableSimpleType();
IWDAttributeInfo attInfo2 = wdContext.nodeSubmitElements().getNodeInfo().getAttribute(IPrivateDemurrageSubmit.ISubmitElementsElement.SECOND_INVOICE_DOC);
attInfo2.getModifiableSimpleType();
//@@end
}
Hi,
It couldn´t find the attibute, therefore attributeInfo is null.
Can you try somethin like
wdContext.currentJobsElementElement.getAttribute(`JOB`)
Good luck, Roelof
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please create element of your node called JobsElement first.
wdContext.nodeJobsElement.addElement(wdContext.nodeJobsElement.createElement);
in the wdIinit of your component controller and then again run and deploy it
Thanks and Regards
Avijit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is there a node Jobs containing a value attribute "job".
Seems it cant find that attribute.. ! Check some spellin mistake.. !
Regards
Bharathwaj
PS :@ Satish : Thats incorrect. For accessing attribute info you just need the attribute.
Message was edited by:
Bharathwaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mathi,
The reason is you are trying to access a node which has no elements.
Check the nodes for elements before accessing it.
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.