cancel
Showing results for 
Search instead for 
Did you mean: 

Popup window null pointer exception

Former Member
0 Kudos

Hi,

I have created a web dynpro application like this: a first window with a button that calls a popup with user info and telephone number and a button OK.

When I click on OK, the popup window close perfectly, but if I click again on the button of the first page to see again the popup, I get a null pointer exception error:

The initial exception that caused the request to fail, was:

java.lang.NullPointerException

at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.handle(ApplicationWindow.java:258)

at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.handleWindowEvents(ApplicationWindow.java:239)

at com.sap.tc.webdynpro.clientserver.cal.AbstractClient.executeTasks(AbstractClient.java:149)

at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:321)

at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:713)

The popup code:

IWDWindow myPopup = wdContext.currentPopupNodeElement().getPopupAttribute();
if (myPopup == null)
{
	IWDWindowInfo windowInfo = wdComponentAPI.getComponentInfo().findInWindows("PopWin");
	myPopup = wdComponentAPI.getWindowManager().createModalWindow(windowInfo);
	myPopup.setWindowPosition(200, 200);
	wdContext.currentPopupNodeElement().setPopupAttribute(myPopup);
	wdContext.currentPopupNodeElement().setUserName("thibault");
	wdContext.currentPopupNodeElement().setUserTelNumber("01010101");
}
myPopup.show();

The close function for the popup:

IWDWindow window = wdContext.currentPopupNodeElement().getPopupAttribute();
window.hide();
window.destroyInstance();

Has any one got any solution, I would really appreciate your help.

Thibault Schalck

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Try changing your code like this under popup.

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

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

wdContext.currentPopupNodeElement().setPopupAttribute(myPopup);

myPopup.setWindowPosition(200, 200);

wdContext.currentPopupNodeElement().setPopupAttribute(myPopup);

wdContext.currentPopupNodeElement().setUserName("thibault");

wdContext.currentPopupNodeElement().setUserTelNumber("01010101");

myPopup.show();

Kiran

Answers (2)

Answers (2)

Former Member
0 Kudos

kiran,

Thank you for the answer, it works perfectly.

Ayyapparaj KV, sorry but with your source code the popup window never re-open...

I'll give full points to Kiran.

Thank you guys for your help, I realy appreciate.

Have a good day.

Thibault Schalck

Former Member
0 Kudos

Hi,

Change the code to

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

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

myPopup.setWindowPosition(200, 200);

wdContext.currentPopupNodeElement().setPopupAttribute(myPopup);

wdContext.currentPopupNodeElement().setUserName("thibault");

wdContext.currentPopupNodeElement().setUserTelNumber("01010101");

myPopup.show();

Regards

Ayyapparaj