cancel
Showing results for 
Search instead for 
Did you mean: 

Pop-Up window error

Former Member
0 Kudos

Hi all,

On Click of Continue button i want to show a pop-up window as "Do u want to continue" with 2 buttons as OK and Cancel

the code i wrote is given below




IWDControllerInfo controllerInfo = wdControllerAPI.getViewInfo().getViewController();
String dialogText="Do you want to Continue;

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

By deploying it is giving error as

Error stacktrace:

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:926)

at com.sap.tc.webdynpro.SearchView.onActionsearch(SearchView.java:165)

at com.sap.tc.webdynpro.wdp.InternalSearchView.wdInvokeEventHandler(InternalSearchView.java:150)

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:100)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.handleActionEvent(WebDynproMainTask.java:299)

at com.sap.tc.webdynpro.clientserver.task.WebDynproMainTask.execute(WebDynproMainTask.java:635)

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

at com.sap.tc.webdynpro.clientserver.cal.ClientManager.doProcessing(ClientManager.java:249)

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)

Can anyone plz help me out

Regards

Padma N

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

have you created an eventhandler with the name "ok" and "cancel"?

Regards,

Dennis

Former Member
0 Kudos

Hi Dennis ,

I created EventHandler methods which are given below...


 public void Ok(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
  {
    //@@begin Ok(ServerEvent)
      //@@end
  }
 public void Cancel(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
  {
    //@@begin Cancel(ServerEvent)
    //@@end
  }

Regards

Padma N

Former Member
0 Kudos

Ok,

it seems taht you try to create the confirmation window in the view. But I would say it is better to do so in the Controller.

Maybe that is also the reason why this is not working, you are trying to access the Window Manager in the View. maybe you should use the window manager of the component controller like:

wdThis.wdGetComponentController().wdGetAPI().getWindowManager().createConfirmationWindow()

Regards,

Dennis

Answers (3)

Answers (3)

Former Member
0 Kudos

HI padma,

The action u have give is case sensitive "ok" .Give the correct action as "Ok".

Karthik

former_member751941
Active Contributor
0 Kudos

Hi Padma,

According to your code event handler name should be <b>ok</b> and <b>Cancel</b>

String dialog = "Put Dailog Message";

IWDConfirmationDialog confDialog = wdComponentAPI.getWindowManager().createConfirmationWindow(dialog,wdThis.wdGetAPI().getViewInfo().getViewController().findInEventHandlers("Ok"),"OK");

IWDEventHandlerInfo CancelEventInfo = wdThis.wdGetAPI().getViewInfo().getViewController().findInEventHandlers("Cancel");

confDialog.addChoice(CancelEventInfo,"Cancel");

confDialog.setTitle("My Pop Up Window");

confDialog.setWindowPosition(350,150);//Change x,y as you want

confDialog.setWindowPosition(WDWindowPos.LEFT);

confDialog.show()

Also Check

<b> at com.sap.tc.webdynpro.SearchView.onActionsearch(SearchView.java:165)</b>

Regards,

mithu

Former Member
0 Kudos

Hi,

Conformation window is comming on click of continue with 2 buttons as Ok and Cancel..

But on click of continue it has to go prevoius view and on click of cancel it has to be in that view only...

So in the Ok and cancel methods i wrote


public void Ok(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
  {
    //@@begin Ok(ServerEvent)
    wdThis.wdFirePlugToView2();
    //@@end
  }

  //@@begin javadoc:Cancel(ServerEvent)
  /** Declared validating event handler. */
  //@@end
  public void Cancel(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
  {
    //@@begin Cancel(ServerEvent)
    //@@end
  }

but for me the popup window is comming in the previous screen means the screen which has to be dispalyed after clicking on Ok button

Regards

Padma N

former_member197348
Active Contributor
0 Kudos

Hi Padma,

If you have created the actions and still getting problems, check the names of event handlers in the code. They are case-sensitive.

<b>Ok</b> but you have given <b>"ok"</b> in the confirmationDialog eventhandlers. Please change it as <b>Ok </b>

regards,

Siva

Message was edited by:

Siva Rama Krushna