cancel
Showing results for 
Search instead for 
Did you mean: 

How to get current PopUp Window

Former Member
0 Kudos

Dear All,

I am using NetWeaver 7.1 sp1 and facing a problem. Actually I want to show a view in popup window. The popup window works fine but i want to get currently popup window. How can i get it in View and controller ??

I found a solution : wdContext.currentPopupElement().getWindowInstacnce();

but in wdContext there is no method like .currentPopupElement(). plz help.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

thks all

Former Member
0 Kudos

You can store the popup window in a context attribute of the component controller and map this attribute from any other controller that needs to access the popup. The sample code you gave obviously uses a helper node named "Popup" (probably cardinality=1:1, selection=1:1) that contains this attribute which is named "windowInstance", but you can also add it directly to the context root.

Maybe even better would be to encapsulate the opening and closing of the popup with component controller methods and keep the window instance private to the component controller.

Armin

Former Member
0 Kudos

Hi Armin,

I thought the Component's and View's were treated as Request Bean's and could be destroyed or server thru different requisitions based on server load / demand. Context of course would be Session based. - So I'd not use instance variables unless they were Singletons. Can you confirm?

Otherwise, we would have one instance of a window, one instance of the component for each requisition, or client. That means, 1000 clients, 1000 of the same view being maintained in server memory? - I really hope it's not like this.

Regards,

Daniel

Former Member
0 Kudos

I don't get your argument. We are talking about a modal popup window here and when this window is closed, the application can destroy it if needed. And if the method to close it is inside the component controler it will destroy the popup and clear the reference to it.

Armin

Former Member
0 Kudos

Hi Armin,

In a simple way, I'm recommending using a Context Variable, type IWDWindow to store the reference of the Window in the user Session Context.

Storing instance variables inside a View (which later will be used) is too risk since most View's we use has lifespan "framework_controlled". You can still use them, but in the problem above, best choice is keeping it in the Context.

Regards,

Daniel

Former Member
0 Kudos

I did not propose to store the popup window instance in the view controller but to store it in the component controller and to set it to NULL when the popup is closed.

Armin

Former Member
0 Kudos

Still the same, unless hes controlling the lifespan of the Controller, he might run into some "weird" behaviours once a while.

Former Member
0 Kudos

Can you explain how the modal window could live longer than the component controller?

Armin

former_member185086
Active Contributor
0 Kudos

Hi

wdContext.currentPopupElement().getWindowInstacnce();

Here PopupElement is a attribute of IWDWindow type where u have to put the window instances (say For close or life control of that popup)

For further plz go through these doc

1. [Dialog|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/903fed0d-7be4-2a10-cd96-9136707374e1&overridelayout=true]

2. [Popup Window|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/a04870c5-749b-2b10-06ba-d25515ef39e3&overridelayout=true]

Best Regards

Satish Kumar

Former Member
0 Kudos
chintan_virani
Active Contributor
0 Kudos

Check if you have Popup value node in your context hierarchy in NWDS. Also post your context hierarchy.

Chintan