cancel
Showing results for 
Search instead for 
Did you mean: 

I need the code for creating popup windows and code for open and close

Former Member
0 Kudos

I can write the code for creating popup window , i am getting problem while trying to open and closing that popup windows.

Can anybody help me in that pls ?

Regards

Sreeni.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sreeni,

Have a look at the following link. It might be of some help to you.

Regards,

Gopal.

Answers (5)

Answers (5)

Former Member
0 Kudos
Former Member
0 Kudos

Hi,

To open a window-popup , first you need to create a context attribute 'WindowPopUp' of type - com.sap.tc.webdynpro.services.session.api.IWDWindow.

Then on the action on which the pop-up should be opened use the following code :

For pop up window

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

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

window.setWindowPosition (300, 150);

window.show();

wdContext.currentContextElement().setWindowPopUp(window);

For closing window code

IWDWindow window = wdContext.currentContextElement().getWindowPopUp();

window.hide();

window.destroyInstance();

Hope this will be helpful.

Thanks

Ritushree

Former Member
0 Kudos

Hi

For pop up window

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

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

window.setWindowPosition (300, 150);

window.show();

wdContext.currentYourNodeElement().setPopupAttribute(window);

For closing window code

IWDWindow window = wdContext.currentYourNodeElement().getPopupAttribute();

window.hide();

window.destroyInstance();

For more infornation refer this link

http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/20d2def3-f0ec-2a10-6b80-877a71eccb68&override...

This link is very useful for you.

Regards

Ruturaj

Edited by: Ruturaj Inamdar on Aug 13, 2009 9:10 AM

Former Member
0 Kudos

Hi Sreeni,

I hope the link I gave you resolves the problem. But, let me know if you need any further help.

Regards,

Gopal.

Former Member
0 Kudos

Hi,

1)Create value attribute of type com.sap.tc.webdynpro.services.session.api.IWDWindow

//code to open

2) IWDWindowInfo windowInfo = wdComponentAPI.getComponentInfo().findInWindows("<popup window name>");

IWDWindow window =wdComponentAPI.getWindowManager().createWindow(windowInfo,true);

window.open();

wdContext.currentContextElement().set<window instance att. name>(window);

3)//To close the popup window

IWDWindow window =wdContext.currentContextElement().get<window instance att. name>();

window.destroy();

For dialogue boxes [help|http://help.sapcom/saphelp_erp2005/helpdata/en/b0/184540631d6f13e10000000a1550b0/frameset.htm]

Regards,

srikanth