cancel
Showing results for 
Search instead for 
Did you mean: 

Code to get error message in small pop up window.

Former Member
0 Kudos

Hi,

I got this code to get error message in pop up window. But this code is giving null pointer exception.

Can any one tell what is the exception. and how to solve it.

IWDConfirmationDialog dialog;
		String dialogText = "Duplicate value ";
		dialog = wdComponentAPI.getWindowManager().createConfirmationWindow(
		dialogText,
	      wdControllerAPI.getControllerInfo().findInEventHandlers("ok"),
		"ok"
		);
		dialog.open();

Regards,

H.V.Swathi

Accepted Solutions (1)

Accepted Solutions (1)

nikhil_bose
Active Contributor
0 Kudos

HI,


wdControllerAPI.getControllerInfo().findInEventHandlers("ok"),

1. check the Event Handler is in component controller itself (not in view since your code is pointing to component controller)

2. name of Event Handler is case-sensitive.

nikhil

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

Most probably you are getting the null pointer exception because of wdControllerAPI.getControllerInfo().findInEventHandlers("ok") as WD is not able to find the ok event handler.

I guess you have already defined the "ok" event handler in your view .

Considering that the name of the event handler is "ok" , you can make the following change in

your code


confirmDialog = wdComponentAPI.getWindowManager().createConfirmationWindow(dialogText,wdThis.WD_EVENTHANDLER_ON_ACTION_OK, "ok");

Regards,

Ashish

former_member205363
Contributor
0 Kudos

Hi Swathi,

Try to use this code, working fine

IWDControllerInfo controllerInfo = wdControllerAPI.getViewInfo().getViewController();

String dialogText = "You really want to delete....";

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

dialog.addChoice(controllerInfo.findInEventHandlers("No"),"No");

dialog.setTitle("Delete Confirmation");

dialog.show();

Regards,

Lakshmi Prasad.

former_member185086
Active Contributor
0 Kudos

Hi Swathi

Use this code which you mentioned is deprecated So it might be the cause of the error ,other thing is event handler Id.

IWDWindowManager dialog = null;

String dialogText = "Duplicate value ";

dialog.createConfirmationWindow("confirmation message", wdThis.wdGetTestAction(),dialogText);

Let see

Best regards

Satish Kumar