cancel
Showing results for 
Search instead for 
Did you mean: 

Closing active popup and then calling view in other window

Former Member
0 Kudos

Hello,

I've got a question. I open a window from my main window. In this popup the user can choose something and the push a button. When the user pushes the button, the popup window has to close and a view from the other window has to be shown, not the view from which the popup window was created.

Is this possible?

If i can get my hands on the correct view instance, i can fire a plug but i cant seem to get this.

I already tried to look into <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/a137c339-0b01-0010-a688-a87b88706845">How to Navigate Inside Web Dynpro Component Interface Views</a> but im kinda getting confused there.

Can anyone help me out?

Much thanks,

Hugo Hendriks

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

If u r using portal to display the iView then,

In the popup Close action just write an event to open the desired view in the main window, provided ur initial view and the target view that u r expecting should be inside the same window.

OnActionClose

{

//Close the window.

wdportalEventing.fire("<namespace>","<description>","");

}

In the target view

init()

{

wdportalEventing.subscribe("<namespace>","<description>",<create an action and then call>);

}

If u r not using portal then,

Try with Component controller eventing.

-Rathna.

Former Member
0 Kudos

Hi Rathna,

Im not using a portal. I dont know if its possible but is there something like in Java Swing where u can create a listener and subscribe a component. Then i can fire an event from the subscriped component to let the other one know something happened.

That i can use to let the detail view know, the popup is done and then the detail view can destroy the popup and navigate back to the masterview.

Is this possible? To create a listener in a view for a window and fire an event from the window?

Im new webdynpro so im still trying to figure out how it works...sorry for all the questions.

thx

Hugo

Former Member
0 Kudos

Hi,

Below the codes of destroying the popup window, write the code to fire the plug to next view. so you can see the other view would be placed there instead of that first view.

regards

karthik

Former Member
0 Kudos

I would like to fire the plug but i need the correct view instance for that. I tried getting this by looking for it through the window but it doesnt work. I tried something like this:


wdContext.currentContextElement().getCurrentPopup().destroy();
IWDWindowInfo apWindowInfo = (IWDWindowInfo) wdComponentAPI.getComponentInfo().findInWindows("APWindow");
IWDViewUsageInfo viewInfo = apWindowInfo.getViewUsageByID("taskDetailsView");
TaskDetailsView view = (TaskDetailsView)viewInfo.getView();
view.firePlugToMainView();

regard,

Hugo

Former Member
0 Kudos

Hi

try this

You have to write the handle in the popup parent window.

IWDWindow window =wdContext.currentPopWindowInstanceElement().getWindowInstance();

window.destroy();

//Do the Fire plug

wdThis.wdfirePlugToMainView();

Kind Regards

Mukesh

Former Member
0 Kudos

I generate the buttons in the popup view so i can not create handelers for them when i create the popup window.

Is there really no way to lookup a view in another window by id or so?

grtz

Hugo

Former Member
0 Kudos

Hi Hugo,

First you have to tell us onething. what do you have done for closing the popup window.

regards

karthik

Former Member
0 Kudos

Ok...to be more specific.

I have a MainWindow with a 2 views in it. A master and a detail view. When im in the detail view and the user clicks a button a new window is created as a popup in this manner:


IWDWindowInfo windowInfo = (IWDWindowInfo) wdComponentAPI.getComponentInfo().findInWindows("ExecutePopupWindow");
IWDWindow popup = wdComponentAPI.getWindowManager().createWindow(windowInfo, true);
popup.setWindowPosition(300, 150);
popup.setWindowSize(300, 600);
popup.setTitle("Execute");
popup.open();
wdContext.currentContextElement().setCurrentPopup(popup);

In the popup...several buttons are generated but every action behind those buttons have to result into the closing of the window and returning to the other window's master view. (When i close the popupwindow the details view is visible)

I tried somehting like:


public void onActionCancel(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
  {
    //@@begin onActionCancel(ServerEvent)
wdContext.currentContextElement().getCurrentPopup().destroy();
IWDWindowInfo apWindowInfo = (IWDWindowInfo) wdComponentAPI.getComponentInfo().findInWindows("APWindow");
IWDViewUsageInfo viewInfo = apWindowInfo.getViewUsageByID("taskDetailsView");
TaskDetailsView view = (TaskDetailsView)viewInfo.getView();
view.firePlugToMainView();
    //@@end
  }

Hope it is more clear now.

thanks in advance,

Hugo

Former Member
0 Kudos

Hi,

you code is clear now. but why shuold yu use follwing statement.

view.firePlugToMainView();

instead of this you can simply write,

wdThis.wdFirePlugToMainView(); //after the destroy statement

Former Member
0 Kudos

Hi,

The plug is situated on the detail view of the other window and is thus not available from wdThis.....because this is another window in another view or can u get a refence to any plug anywhere?

Former Member
0 Kudos

Hi,

try this thread,

hope this will help you

regards

karthik

vijayakhanna_raman
Active Contributor
0 Kudos

Hi,

Do the same thing Find the view is in which window and

call the this window as u called this current pop-up window.

Regards,

Vijayakhanna Raman