Skip to Content
avatar image
Former Member

Close an External Windoe

Hi Colleagues,

Here in our requirement we have two Webdynpro applications

From the rist webdynpro application, i am calling second webdynpro application using

IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(urlToTargetApp);

window.show();

And the second application contains a Close button

Could any one pplease let me know how can i close this second window (in my second webdynpro application)

Manythanks & Regards

Swetha

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Jul 07, 2009 at 05:44 AM

    Hi Swetha,

    Create a context attribute named "WindowInstance" in component controller and change the type to com.sap.tc.webdynpro.services.session.api.IWDWindow. Map it to both your views.

    Now store the instance of window in this context attribute.

    IWDWindow window = wdComponentAPI.getWindowManager().createNonModalExternalWindow(urlToTargetApp);
    wdContext.currentContextElement().setWindowInstance(window);
    

    When you click on the close button in the view2 then execute

    IWDWindow windowInstance = wdContext.currentContextElement().getWindowInstance();
    windowInstance.destroyInstance();
    

    Regards,

    Jaya.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 07, 2009 at 05:28 AM

    Hi Swetha

    Check out this link you will get solution

    how-to-close-external-window

    Thanks

    Tulasi

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 07, 2009 at 06:46 AM
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 07, 2009 at 07:20 AM

    Hi,

    Try this code,

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

    window.destroy();

    or

    window.close();

    or

    window.destroyInstance();

    Regards,

    sunaina Reddy T

    Add comment
    10|10000 characters needed characters exceeded