on 03-06-2007 10:58 AM
Hi All,
While creating a confirmation dialog window i am getting 'Null pointer exception' error. But when the ear is deployed it works fine for a certain period of time and later on throws this exception.
And as soon as it is again deployed even without making changes it starts working.
The code used for creating a confirmation window is as below:
confirmDialogWin = wdComponentAPI.getWindowManager().createConfirmationWindow("Do you want to cancel the order ?",wdControllerAPI.getViewInfo().getViewController().findInEventHandlers("ok"),"Yes");
confirmDialogWin.addChoice(wdControllerAPI.getViewInfo().getViewController().findInEventHandlers("cancel"),"No");
confirmDialogWin.setTitle("Order Cancellation Confirmation :");
confirmDialogWin.open();
confirmDialogWin.setWindowPosition(WDWindowPos.CENTER);
The event ok and cancel has been defined in the view.
//@@begin others
public static IWDConfirmationDialog confirmDialogWin = null;
//@@end
Help me on this as soon as possible.
Thanks in advance,
Murtuza
Is Event handler name correct?
"ok","cancel" are name of actions.Event handler name would be onAction<actionname>.Check it once again.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Murtuza,
First of all, make variable confirmDialogWin non-static, i.e. remove word static from declaration.
Second, it seems that you creating your window in wdDoModifyView -- otherwise why you need static? Don't do this -- create and close popup windows only from action handlers or event handlers or controller methods these are not invoked from wdDoModifyView.
Valery Silaev
SaM Solutions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
i am also giving you the error that i get
java.lang.NullPointerException
at com.sap.tc.webdynpro.clientserver.window.ConfirmationDialogDelegate.<init>(ConfirmationDialogDelegate.java:58)
at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.createConfirmationWindow(ClientComponent.java:927)
at com.chep.portfolio.dynpro.DetailedOrderView.doConfirmationDialog1(DetailedOrderView.java:445)
at com.chep.portfolio.dynpro.DetailedOrderView.onActionDoCancel(DetailedOrderView.java:234)
at com.chep.portfolio.dynpro.wdp.InternalDetailedOrderView.wdInvokeEventHandler(InternalDetailedOrderView.java:233)
at com.sap.tc.webdynpro.progmodel.generation.DelegatingView.invokeEventHandler(DelegatingView.java:87)
at com.sap.tc.webdynpro.progmodel.controller.Action.fire(Action.java:67)
at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleAction(WebDynproMainTask.java:101)
at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleActionEvent(WebDynproMainTask.java:304)
at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:659)
at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:59)
at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:251)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doWebDynproProcessing(DispatcherServlet.java:154)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:116)
at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:55)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:390)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:264)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:347)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:325)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:887)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:241)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:148)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Thanks
Where is it exactly throwing the error? Check Line No in the error trace.
The problem is due to static declaration of variable.There will be one instance of confirmation window for all running applications.So while creating it if somebody closes that window it will throw exception.Remove static declaration
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry, i made a mistake in the message above. I have already created the event handlers ok and cancel in the view.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
This is the standard code for craeting the Confirmation dialog with ok and new Email.....
And it is always works.
IWDControllerInfo controllerInfo = wdControllerAPI.getViewInfo().getViewController();
String dialogText = "The email was successfully sent!";
IWDConfirmationDialog dialog =
wdComponentAPI.getWindowManager().createConfirmationWindow(
dialogText,
controllerInfo.findInEventHandlers("ok"),
"ok");
dialog.addChoice(controllerInfo.findInEventHandlers("newEmail"), "new email");
dialog.open();
Thanks,
Lohi.
Hi Lohi,
The way you have mentioned is the same as i provided earlier except an abject being created at the start. I don't think that should make a difference. The reason i m asking for a confirm solution because i need to wait for about a day to see does that code give the same null pointer exception or not and as i mentioned earlier if i write the code which i mentioned then a confirmation window is created succesfully and there are no issues in that but after a certain period of time i gives me null pointer exception and if i again redeploy the same code without making any changes then it works fine. So as per my understanding there is no issue in the code as it creates a window successfully.
hi,
Go to methods of your View and create the eventHandler method name ok and cancel
Then try to deploy once again.
It should come.
Thanks,
Lohi.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
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.