cancel
Showing results for 
Search instead for 
Did you mean: 

PopUp Window

Former Member
0 Kudos

Hello

I am working on an aplication that opens a popup (In the same window).

I have to choose some options from the popup, and depending on the selected options, I neet to redirect the browser to a diferent window (View).

When I destroy the object, the last page i was visiting apears, but is not the necesary page I need to go.

I tried using a context parameter, but I don´t know what action is executed when popup is closed.

I also tried to add the view to the Diagram view, but I get an error like that i am instancing again an object.

I tried a few more thing, but none of them work.

Thanks in advanced, and happy new year.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Toxicus,

How do you make the redirect.

Try this.


if (WDPortalUtils.isRunningInPortal()) {
    WDClientUser.forceLogoffClientUser(<your url>t);
} else {
   wdThis.wdGet<name>WindowInterfaceViewController().wdFirePlugPlugExit(<your url>);
}

regards

Gunter

Former Member
0 Kudos

Thanks for your answer.

This code goes in the pop up after destroying the Pop Up (iView under a window)?

And what do you mean by URL?

In Web Dynpro, the URL (http:

.........) doesent change in all the aplication, and I need to go to a specific View.

Where or how can I get the URL of a specific View?

The problem is that I need to redirect from an open pop up inside a window, and the redirection sholud look like when I do click and execute a fireplug, and I do´'t know how.

Thanks again.

Former Member
0 Kudos

Is your view in the same window component like the other ones?

When yes all you have to define are the inbound and outbound plugs for the views.

At least when you destroy the popup you have to fire the plug and then the view in the background changed from the popup calling view to the target view.

Syntax of firing a plug:

wdThis.wdFirePlug<name of plug>();

Hope it helps.

Former Member
0 Kudos

This is the deal:

PopUp window loads inside a "mother window", but they are two different windows, so I can´t fire a plug of the "mother window" from the pop UP itself. (As far as I know)

The Pop UP shows in a diferent Diagram View than the rest of the proyect, so I cant add plugs to other windows. (If I add them, I get errors)

The destroy method is inside the popUp.

Is there a way to know from the "mother window" when a pop up was closed, so when this happends, I can check some context variables and fire a plug? (Like an event in the "mother window" on popupClose or something like that)

Is there another way to solve the problem?

Thanks

Former Member
0 Kudos

Hi,

I was thinking that you want to redirect to new IView not a WD view.

For the navigation to an other WD view you can close the popup and than fire the plug.

regards

Gunter

Edited by: Gunter Werner on Jan 6, 2010 4:24 PM

Former Member
0 Kudos

Thanks.

This would be the solution. Close the window and fire the plug, but:

How can I know when the window (pop up) is closed, so that the "mother window" can fire the plug?

I hope I am not bothering any one with this silly questions, but I have spend lots of time and made like 1000 experiments.

Former Member
0 Kudos

Hi,

try it should work. The runtime enviroment of the WD should handle this.

Former Member
0 Kudos

Is there a way to know when a pop up is closed, so I can automaticaly fire a firePlug?

If not, I was thinking on after calling the pop up, make a while statment that stays there until a context variable change.

When I close the pop up or destroy it, then, I change the context variable, abd brake the loop and finaly fire the firePlug.

Maybe Í'll put some waiting time to avoid too much resource conuming between while loops.

Is there a more efective or elegant way?

I'm felling like an artisan.

Thanks for all your answers.

I´ll post when if this work.

Thanks again

Former Member
0 Kudos

I just tried the wdFireplug from wdDoModifyView, and it didn´t work.

Evin if I put the fireplug in a method and use wdDoModifyView to call the method.

Former Member
0 Kudos

If you want to redirect from the parent window, you need to create an event handler and handle the event in the parent window.

Parent window will close the pop window and handle the logic to redirect or do what ever you want.

Raghu

Former Member
0 Kudos

Hi Toxicus,

I have test it. You only must fire the plug in the event from the confirmation dialog.

Here my coding:

For the dialog.


	IWDEventHandlerInfo eventHandler =wdControllerAPI.getViewInfo().getViewController().findInEventHandlers("Yes");
	IWDConfirmationDialog dialog =
	wdComponentAPI.getWindowManager().createConfirmationWindow("Only redirect", eventHandler, "Yes");
	IWDEventHandlerInfo no =	wdControllerAPI.getViewInfo().getViewController().findInEventHandlers("No");
	dialog.addChoice(no, "No");
	dialog.setWindowPosition(WDWindowPos.CENTER);
	dialog.show();

For the eventhandler of the confirmation dialog.


//@@begin javadoc:Yes(ServerEvent)
  /** Declared validating event handler. */
  //@@end
  public void Yes(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
  {
    //@@begin Yes(ServerEvent)
    wdThis.wdFirePlugToView2out();
    //@@end
  }

regards

Gunter

Former Member
0 Kudos

Hi,

There are two scenarios:

If you are running your application on EP then use WDPortalNavigation API to navigate to the particular iView based on the selection on the open popup window. Close the window and fire an event and in the event handler in the parent view put the code to navigate using the above API.

If your application is standalone then use outbound plug and get the target view url using the following code:


String objname = wdComponentApi.getDeployableObjectPart().getDeployableObjectName();
String partname = "SecondCompApp" //this is the name of the iview you get from properties.
WDDeployableObject wdDop="null";
try{
WdDop = WDDeployableObject .getDeployableObjectPart(deployableObjectName,partname,WdDeployableObjectparttype.APPLication)}
catch{}
//shld surrounded in the try block.
String url=WDUrlGenerator.getApplicationURL(WdDop);

Hope it helps.

Regards,

Manoj

Answers (0)