cancel
Showing results for 
Search instead for 
Did you mean: 

Confirmation Dialog Box

Former Member
0 Kudos

Hi,

I want to create confirmation dialog box. My all coding is dynamically created. plz help me out.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

ya i've create event handlers for it. but getiing the same error....... what can i do?????

Former Member
0 Kudos

Hi,

Can you post the code and the error stack and the code at that line.

Regards

Ayyapparaj

Former Member
0 Kudos

java.lang.NullPointerException

at com.sap.tc.webdynpro.clientserver.window.ConfirmationDialogDelegate.<init>(ConfirmationDialogDelegate.java:79)

at com.sap.tc.webdynpro.clientserver.cal.ClientComponent.createConfirmationWindow(ClientComponent.java:987)

at com.sap.tut.popup.Email_View.onActionButton_Send(Email_View.java:346)

at com.sap.tut.popup.wdp.InternalEmail_View.wdInvokeEventHandler(InternalEmail_View.java:164)

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.window.WindowPhaseModel.doHandleActionEvent(WindowPhaseModel.java:420)

at com.sap.tc.webdynpro.clientserver.window.WindowPhaseModel.processRequest(WindowPhaseModel.java:132)

at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.processRequest(WebDynproWindow.java:335)

at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:143)

at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:299)

at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:711)

at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:665)

at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:232)

at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:152)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)

at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doPost(DispatcherServlet.java:53)

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)

The line no 346 represents:

IWDConfirmationDialog dialog = wdComponentAPI.getWindowManager().createConfirmationWindow(dialogText,controllerInfo.findInEventHandlers("ok"),"ok");

former_member197348
Active Contributor
0 Kudos

Hi Amit,

Event handler name "ok" is case-sensitive. Check whether you are giving right name (and case) in both places in event handler's method signature and in method call controllerInfo.findInEventHandlers().

regards,

Siva

Answers (5)

Answers (5)

Former Member
0 Kudos

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();

i wrote this code but it's giving me "java.lang.NullPointerException " error.

Former Member
0 Kudos

have you created event handler with name "ok"..if not do that!!

similarly event handler "newEmail"

Edited by: Alok Jain on Jan 22, 2008 12:43 PM

Former Member
0 Kudos

Hi,

You need to have events with names ok and newEmail. Remember it should be exactly same. And in these event methods you can put your code what you want to do on click of ok and new mail.

I think you have not defined these methods.

Change the first line of the code to:

IWDControllerInfo cont = wdControllerAPI.getControllerInfo();

May be your controllerInfo is null.

Edited by: Manoj Kumar on Jan 22, 2008 5:17 PM

Former Member
0 Kudos

Hi,

Just assure that you have created the event handler with the same name under Methods tab (keep case sensitivity in mind).

Regards,

Murtuza

Former Member
0 Kudos

Hi Amit,

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();

i wrote this code but it's giving me "java.lang.NullPointerException " error.

Have you created the event handlers for ok and newEmail

Regards

Ayyapparaj

Former Member
0 Kudos
Former Member
0 Kudos

Hi,

1. Create 2 eventhandlers named "Yes" and "No" under Methods tab.

String dialogtext = "Are you sure you want to delete?";

IWDEventHanlderInfo eventhandler = wdControllerAPI.getViewInfo().getViewController().findInEventhandlers("Yes");

IWDConfirmationDialog dialog = wdComponentAPI.getWindowManager().createConfirmationWindow(dialogtext,eventhandler,"Yes");

eventhandler = wdControllerAPI.getViewInfo().getViewController().findInEventhandlers("No");

dialog.addChoice(eventhandler,"No");

dialog.show();

Regards,

Murtuza

Former Member
0 Kudos

Hi,

Below link contains the tutorial which will help you to create the dialog box dynamically.

[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/28113de9-0601-0010-71a3-c87806865f26?rid=/library/uuid/49f2ea90-0201-0010-ce8e-de18b94aee2d#23 [original link is broken]]

thanks & regards,

Manoj

Former Member
0 Kudos

Hi,

Following is the usage

IWDConfirmationDialog dialog =wdComponentAPI.getWindowManager().createConfirmationWindow(confirmationText, action, label)

@param confirmationText - the text which is displayed inside of the dialog

@param action - the action which is fired, if the representing button is pressed in the dialog.

@param label - the label of the representing button

Regards

Ayyapparaj