cancel
Showing results for 
Search instead for 
Did you mean: 

Exception while Creating Confirmation Dialog Window

Former Member
0 Kudos

Hi,

Iam trying to create a confirmation Pop up window on the click of a "Save" button. I followed the procedure mentioned in the following link :

http://wiki.sdn.sap.com/wiki/display/WDJava/CreatingConfirmationDialogBoxinWebDynproJava

But when i click on Save button, iam getting this exception -

com.sap.tc.webdynpro.services.exceptions.CreationFailedException: add of choice failed! (eventhandler: null)

at the following line :

IWDConfirmationDialog confDialog = wdComponentAPI.getWindowManager().createConfirmationWindow(

/* dialogText, evtHndlr, buttonText OR evtHndlr.getName() */

wdComponentAPI.getTextAccessor().getText("GoHomeConfQuestion"),

evtHndlr,

wdComponentAPI.getTextAccessor().getText("GoHomeConfCancel")

Can any one please suggest me where iam going wrong and what is the cause of this exception?

Thanks in advance.

Regards,

Maggie

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Please make sure that you have created event handlers for each button.

From the Wiki, ensure event handler with name GoHome_Canceled is created.

Regards,

Saravanan K

Former Member
0 Kudos

Hi,

I created event handlers for each button. and also made sure that the event handlers in the code are exactly the same as in the methods tab.

But still iam getting this error.

Former Member
0 Kudos

Sample code

dialog part

IWDConfirmationDialog createDialog=wdComponentAPI.getWindowManager().createConfirmationWindow("You are going to Submit. Are you sure?",ctrl.findInEventHandlers("create"),"YES");

createDialog.addChoice(ctrl.findInEventHandlers("doNothing"),"NO");

createDialog.open();

you have to create event not the metod

public void create(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//your action

}

public void doNothing(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin doNothing(ServerEvent)

//your action

//@@end

}

Former Member
0 Kudos

Hi,

If the event handlers are created, check the message pool for the texts you have used in button.

i.e GoHomeConfQuestion is defined in messagepool

Regards,

Saravanan K

Former Member
0 Kudos

Hi Maggie.

I'm Facing the same error, I follow the same tutorial and all my event handler are creted, the message in the pool, and all the name are correct, but, I still have no Idea how to show the pop.... Actually I'm working in NWDS 7.2...

will any please tell me how this could be resolve?

thanks

Walex