cancel
Showing results for 
Search instead for 
Did you mean: 

need to create confirmation window as popup

Former Member
0 Kudos

Hi

my requirement is to create a popup window, to confirm the user "ok" or "cancel" to take necessary action.

using the below code we were able to create the popup window but after the popup window is displayed and after clicking on the "ok" button we are not able to capture the necessary event.

Currently, the popwindow is displayed upon clicking on the "OK" or "CANCEL" button we are not able to control the user upon the appropriate action

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

IWDEventHandlerInfo hndinf= conf.findInEventHandlers("cancelcheck");

IWDConfirmationDialog confd= wdComponentAPI.getWindowManager().createConfirmationWindow(wdComponentAPI.getTextAccessor().getText("cancel_check"),hndinf,wdComponentAPI.getTextAccessor().getText("ok_check"));

hndinf= conf.findInEventHandlers("okcheck");

confd.addChoice(hndinf,wdComponentAPI.getTextAccessor().getText("confirm"));

confd.show();

Please suggest the way forward.

THanks & Regards

Vijay Krishna S

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi vijay,

Try the below code

IWDControllerInfo controllerinfo=wdControllerAPI.getViewInfo().getViewController();
                 String dialogbox="Some message to display in confirmation doalog box";
		IWDConfirmationDialog dialog=wdComponentAPI.getWindowManager().createConfirmationWindow(dialogbox,controllerinfo.findInEventHandlers("ok"),"OK");
		dialog.addChoice(controllerinfo.findInEventHandlers("cancel"),"CANCEL");
		dialog.show();

Hope it helps and revert back to me if you face any issue

Thanks,

Rahul.

Edited by: rahul.girmaji on Dec 8, 2011 8:04 AM

Former Member
0 Kudos

Thanks Rahul

its done.....

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Vijay,

Try using eventhandlerid instead of eventhandlerinfo. Below is the snippet to do that.


String dialogText = wdComponentAPI.getTextAccessor().getText("cancel_check");
IWDConfirmationDialog dialog = wdComponentAPI.getWindowManager().createConfirmationWindow(dialogText, wdThis.WD_EVENTHANDLER_CANCEL_CHECK, wdComponentAPI.getTextAccessor().getText("ok_check"));
dialog.addChoice(wdThis.WD_EVENTHANDLER_OK_CHECK, wdComponentAPI.getTextAccessor().getText("confirm"));
dialog.show();

Asuming cancelCheck and okCheck are the eventhandlers. Also make sure, appropriate evenhandler is used for each button, as i see that text for first button is "ok_check" and eventhandler for second button is named okcheck.

Regards,

Vishweshwara P.K.M.

Former Member
0 Kudos

Hi

Thanks for the reply......

Iam not able to use eventhandlerid instead of eventhandlerinfo as it is available in the API (Organize Imports).

cancelCheck and okCheck are the eventhandlers used, in the code i have sent it is properly used,

please suggest if it mistakenly written

FYI : I am using NWDS 7.0 SP19

Thanks

vijay