cancel
Showing results for 
Search instead for 
Did you mean: 

Close external window in NW04s

Former Member
0 Kudos

Hi,

We are using the following API in order to close an external window: TaskBinder.getCurrentTask().getClient().sendRedirect("javascript:window.close();",0);

After closing the window, the object in the backend system remain locked (and not released). it seems that the session remains alive and hence the object is locked.

If we close the window with the X of the window, the object of the backend is released as required.

As suggestions?

Thanks,

Aviad

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

why do you want to close the window from WebDynpro?

Is it not enough just to make a close button in that external window?

Or do you mean that if you close the webDynpro window that you are still logged on to the AppServer because of the external window, the session of the Internet Explorer is not ended?

Regards,

Dennis

Former Member
0 Kudos

Exactly, if I close the webDynpro window that I am still logged on to the AppServer because of the external window, the session of the Internet Explorer is not ended.

Thanks,

Aviad

Answers (1)

Answers (1)

former_member751941
Active Contributor
0 Kudos

Hi AVIAD,

Check this.

Step 1: Take a context attribute(WindowInstance) of type “com.sap.tc.webdynpro.services.session.api.IWDWindow”.

Step 2: Take a CloseButton in the View(DisplayView) that is used as a embed View of external Window.

Step 3:

When you are calling the external window set “WindowInstance”

public void onActionDisplayExternal Window(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionDisplayResult(ServerEvent)

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

"DisplayWindow");

// create the Window

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

window.setWindowPosition(WDWindowPos.CENTER);

window.setTitle("WindowTitle");

window.setWindowSize(100,100);

// Save WindowInstance in Context

wdContext.currentContextElement().setWindowInstance(window);

// and show the window

window.show();

//wdThis.wdFirePlugInDisplay();

//@@end

}

Step4: Associate action “CloseWindow” with the “CloseButton

” and destroy the window instance inside it.

public void onActionCloseWindow(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )

{

//@@begin onActionCloseWindow(ServerEvent)

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

window.destroyInstance();

//@@end

}

Regards,

Mithu

Former Member
0 Kudos

Hi,

Thanks but this does not help us since we have an <b>external</b> window.

Any further suggestions?

Thanks,

Aviad