cancel
Showing results for 
Search instead for 
Did you mean: 

Confirmation Dialog Problem

0 Kudos

Hello!

I am facing a peculiar problem in the production system where in the confirmation dialog isn't working and the NullPointerException is getting thrown. For some reason the production server isn’t getting the handle for the event even though they are defined and the same piece of code is working fine in both Dev & QA.

Could someone look into the code and let me know what I can do to make it work.

-


try

{

String dialogTxt = "Are you sure you want to ignore changes? ";

IWDEventHandlerInfo eventIgnore = wdControllerAPI.getViewInfo().getViewController().findInEventHandlers("evtIgnoreChanges");

IWDConfirmationDialog dialog = wdComponentAPI.getWindowManager().createConfirmationWindow(dialogTxt,eventIgnore,"Yes");

IWDEventHandlerInfo eventIgnoreCancel = wdControllerAPI.getViewInfo().getViewController().findInEventHandlers("evtIgnoreCancel");

dialog.addChoice(eventIgnoreCancel,"No");

dialog.setWindowPosition(WDWindowPos.CENTER);

dialog.setWindowSize(250,50);

dialog.open();

}catch(Exception ex)

{

wdComponentAPI.getMessageManager().reportException("Error ignoring changes",true);

ex.printStackTrace();

}

-


Thank you very much in advance.

Regards,

Vikram

Accepted Solutions (0)

Answers (7)

Answers (7)

siddharth_jain
Active Contributor
0 Kudos

Hi,

Might be it is because of Your Production system is running in Clustered environment(Load Balancing) ,And Dev and QA not.

I am not sure whether this is the Problem but this is the only difference i can see apart from version problem.

Siddharth

Former Member
0 Kudos

Hi Greth,

Did you find a solution for this....

IWDWindowInfo windowInfo = (IWDWindowInfo) wdComponentAPI.getComponentInfo().findInWindows("FinalWindow");

// create the u201CAddressbookWindowu201D

IWDWindow window = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);

// set the WindowPosition on the screen

window.setWindowPosition(300, 150);

// and show the window

window.show();

// Save WindowInstance in Context

wdContext.currentTestElement().setInstance(window);

I am getting a null pointer exception?

any help

0 Kudos

Hi,

In order to localize the cause of the problem, we have to find out where the NullPointerException happens. Can you post the stack trace where the exception is thrown?

Regards,

Wei

Former Member
0 Kudos

Hi Vikram,

This May be cause by the version Problem.

Check the SP version for both are equal or not.

Kind Regards

Mukesh.

Former Member
0 Kudos

Vikram,

As far as behavior different on different servers, could you check versions of:

1. Your IDE

2. Your QA and Dev Systems

3. Your production Systems

VS

Former Member
0 Kudos

Hi,

Use this code:

IWDControllerInfo controllerInfo =

wdControllerAPI.getViewInfo().getViewController();

String dialogText = "Are you sure you want to ignore changes?";

IWDConfirmationDialog dialog =

wdComponentAPI.getWindowManager().createConfirmationWindow(

dialogText,

controllerInfo.findInEventHandlers("evtIgnoreChanges"),

"Yes");

dialog.addChoice(

controllerInfo.findInEventHandlers("evtIgnoreCancel"), "No");

dialog.open();

check if you have created events with name evtIgnoreChanges & evtIgnoreCancel in your view controller.

Regards,

Rajeev

0 Kudos

I will try the solution though I don't see any difference. Could you elucidate why the below code not work in production but works on my local m/c,dev & QA.

-


IWDEventHandlerInfo eventIgnore = wdControllerAPI.getViewInfo().getViewController().findInEventHandlers("evtIgnoreChanges");

IWDConfirmationDialog dialog = wdComponentAPI.getWindowManager().createConfirmationWindow(dialogTxt,eventIgnore,"Yes");

-


Regards.

Former Member
0 Kudos

Hi,

Did anyone ever find an explanation for this? I have a similar problem whereby a popup window works correctly in DEV and QA but fails in production with a nullPointerException.

My code is failing on

IWDWindowInfo windowInfo =
			(IWDWindowInfo) wdComponentAPI.getComponentInfo().findInWindows(
				"VendorSrchPopUp");

Thanks,

Gareth.

Former Member
0 Kudos

hai ,

try these code

IWDConfirmationDialog dialog =wdComponentAPI.getWindowManager().createConfirmationWindow(dialogText,

controllerInfo.findInEventHandlers("eventIgnore"),"Yes");

dialog.setWindowSize(90,90);

dialog.open();

regards,

naga raju

Former Member
0 Kudos

hai,

have you created events for "YES" .

try once by creating a event method name d as you wrote "Yes".

regards,

naga raju

0 Kudos

Hello Naga Raju,

evtIgnoreChanges & evtIgnoreCancel events are already declared.

Rgds,

Vikram