cancel
Showing results for 
Search instead for 
Did you mean: 

On creating a confirmation dialog getting null ptr error

Former Member
0 Kudos

Hi Forum

I needed a confirmation dialog i have created two event handlers ie delUserConfirmation_ok and delUserConfirmation_cancel in the controller of my project. Then on the Click event of my delete button in the view I want the confirmation dialog box to appear. So for this I have written the following code:

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

String dialogText = "Do you want to delete the user";

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

dialog.addChoice(controllerInfo.findInEventHandlers("delUserConfirmation_cancel"), "cancel");

dialog.open();

but on clickin the delete button I am getting null pointr error.Also is it possible to hv a click event ie action for the ok button of my dialog box.

Thanks&Regards

Jaspreet Kaur

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Jaspreet,

Just open up the view and select the Method tab and see that you have event handler named delUserConfirmation_ok and delUserConfirmation_cancel and if you don't have then you need to create.

IWDConfirmationDialog dialog =wdComponentAPI.getWindowManager().createConfirmationWindow(dialogText,controllerInfo.findInEventHandlers("<b>delUserConfirmation_ok</b>"),"ok");

dialog.addChoice(controllerInfo.findInEventHandlers("<b>delUserConfirmation_cancel</b>"), "cancel");

Also, confirm that the name is exactly the same that you provided while creating event handlers.(Keep case sensitivity in mind).

Regards,

Murtuza

Former Member
0 Kudos

Thanks Murtuza it worked actually in the sample application it was mentioned tht we need to create the event handler in the controller.

Answers (1)

Answers (1)

Former Member
0 Kudos

hi,

It is because you have not defined the event handlers delUserConfirmation_ok and delUserConfirmation_cancel in your contoller.

thanks & regards,

Manoj

Former Member
0 Kudos

I followed the tutorial given for the dialog box..as i am using for the first time can u pls help me out. U mean to say I need to provide the implementation in the funtion for these two events.

Thanks& Regards

Jaspreet Kaur

Former Member
0 Kudos

Hi,

This methods should exists in the java file.

You can create them from the actions tab.

Regards

Ayyapparaj

Former Member
0 Kudos

ya whatever you want to do on click of Ok and cancel in the confirmation dialog window. Its up to your requirement. You leave the implementation for these event handlers as blank also, but it must be present there in your controller.

Former Member
0 Kudos

They r present in my controller still i am getting the error.I just provided implementation for it then also i am gettin the same error..

Thanks & Regards

Jaspreet Kaur

Former Member
0 Kudos

Can u pls provide a detailed solution as i did not get u.

Thanks & Regards

Jaspreet Kaur

Former Member
0 Kudos

Hi,

Name of the event handlers must be exactly same as what you have mentioned in findInEventHandlers method.

thanks,

Manoj