cancel
Showing results for 
Search instead for 
Did you mean: 

Lifespan of popup window

Former Member
0 Kudos

Hello!

I want controller of a popup window be initialized every time when the window is opened. Is that possible?

I've defined Lifespan for the view "when_visible", but doInit is called only first time, the window was opened.

Of course, I could invalidate context on closing the window (as I manage to fire event, that the window can be closed), but may be there is a simple way to make lifespan working similar to "normal" views?

Thank you!

Best regards,

Nick

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi nick,

What kind of popup window do you want(Confirmation dialog,External, or a regular popup)?

-wael

Former Member
0 Kudos

Hi Wael,

I'm not pretty sure about terminology, I think I'm using "regular popup", though I'm doing similar things to Tutorial 10 "Dialog Boxes in Web Dynpro":

- define a new window and a view in WD component

- open the window using

IWDWindowInfo windowInfo = (IWDWindowInfo)wdComponentAPI.getComponentInfo().findInWindows(NAME);

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

window.setWindowPosition(WDWindowPos.CENTER);

window.open();

- save the window instance in context of the current view

- Define an event in controller

- add event processor to the current view to close popup window by

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

window.close();

- popup window triggers the event in controller and 'parent' view closes the popup.

Best regards,

Nick

BeGanz
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hallo Nick,

call <b>window.destroy()</b> instead of <b>window.close()</b>. Calling the close-method does not destroy the affected view controllers because the window is only closed but not destroyed. It's just invisible at the moment. Consquently the hook-method <i>wdDoInit()</i> is not called again by the Web Dynpro Runtime.

Greetings, Bertram

Answers (0)