on 05-31-2007 10:10 AM
Hi there,
I did the EJB3+Webdynpro Tutorial at http://help.sap.com/saphelp_nwce10/helpdata/en/44/D958673EF05F4DE10000000A11466F/frameset.htm
Unfortunately a model node element seems not to be created (is null). I checked everything what I did twice (every code mentioned is in the controller). What could the problem be?
Cheers,
André
java.lang.IllegalArgumentException: model object must not be null
at com.sap.tc.webdynpro.progmodel.context.ModelNodeElement.(IPrivateStudsWDView.java:397)
at com.sap.demo.wdstuds.studswdapp.comp.wdp.IPrivateStudsWDView$IContextNode.doCreateElement(IPrivateStudsWDView.java:66)
at com.sap.tc.webdynpro.progmodel.context.NodeInfo.createElement(NodeInfo.java:1064)
at com.sap.tc.webdynpro.progmodel.context.Node.createElementInternal(Node.java:1047)[/code]
Hi,
Basically this execption occurs when you are trying to create a element in a model node, where in the model
object is not instantiated inside wdDoInit() of the component controller.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I did write no code in the component controller, I used the view controller (I know and it is stated within the tutorial that this is not good practice, but that it should work).
Here are my view controller methods:
public void wdDoInit()
{
//@@begin wdDoInit()
com.sap.tc.cm.ejb.example.model.MyStudsModel myModel = new com.sap.tc.cm.ejb.example.model.MyStudsModel();
wdComponentAPI.getModelInstanceMap().putDefaultInstance("com.sap.tc.cm.ejb.example.model.MyStudsModel", myModel);
//@@end
}
public void onActionGetStudent(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
{
//@@begin onActionGetStudent(ServerEvent)
try {
// executes the corresponding method on the session facade
wdContext.currentRequest_StudsLocal_getStudentElement().
modelObject().execute();
// forces Web Dynpro to re-create the Request model object
// in order to clear the InputField
wdContext.nodeRequest_StudsLocal_getStudent().invalidate();
// updates the UI elements bound to the Response node
wdContext.nodeResponse().invalidate();
} catch (Exception e) {
e.printStackTrace();
}
//@@end
}
It should be instantiated at this point? Maybe the problem is with modelObject() != myModel ?
Hi,
public void wdDoInit()
{
//@@begin wdDoInit()
com.sap.tc.cm.ejb.example.model.MyStudsModel myModel = new com.sap.tc.cm.ejb.example.model.MyStudsModel();
<b>wdContext.nodeRequestMyStudsModel().bind(myModel );</b>
wdComponentAPI.getModelInstanceMap().putDefaultInstance("com.sap.tc.cm.ejb.example.model.MyStudsModel", myModel);
//@@end
}
Regards,
Naga
This is not answered, I'll restate the question because the page is so full.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Andre,
Please check the name of the model node in the context.
Then try.
public void wdDoInit()
{
//wdContext.node<ModelName>().bind(<ModelName>() ServiceProxy.create());
wdContext.nodeMyStudsModel().bind(MyStudsModelServiceProxy.create());
}
In side onActionGetStudent Method dont use "wdContext.nodeResponse().invalidate();"
Regards,
Mithu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.