Skip to Content
avatar image
Former Member

Closing the window - web dynpro Java

Hi all,

Do you know how to close the window when the user clicks on a button in web dynpro java?

Thanks for your answers.

Karim

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

5 Answers

  • avatar image
    Former Member
    Jun 23, 2008 at 08:21 AM

    if (wdContext.currentContextElement().getWindowcontext() != null)

    {

    wdContext.currentContextElement().getWindowcontext().close();

    }

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 23, 2008 at 08:42 AM

    Hi

    From your post, I am assuming that you are opening a new window like a pop-up from the parent window and want to close it.

    In this case, create a context attribute in the component ( or custom controller,if u have used any ) of type

    com.sap.tc.webdynpro.services.session.api.IWDWindow

    When you open the new window , set this attribute value to the name of this new window.

    Now when you want to close this window on say , a click of a button, then simply access the attribute for window in component controller and use the property 'destroy' to closethe window.

    Regards,

    Sudeep

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi

      From my knowledge close button have one outbound plug.Create one Empty View with inbound plug which is default and bind it to the outbound plug by doing this it close the view.

      if useful give me points

      Thanks and Regards,

      tulasi.Palnati

  • avatar image
    Former Member
    Jun 23, 2008 at 09:07 AM

    Hi,

    Declare two methods in ComponentContrroller

    like openWindow() and closeWindow()

    And in openWindow method write

    String winName=<anotherWindowName>;

    objWindow =

    wdComponentAPI.getWindowManager().createModalWindow(

    wdComponentAPI.getComponentInfo().findInWindows(strWindowName));

    objWindow.setWindowSize(150,200);

    objWindow.open();

    Declare objWindow of type IWDWindow between

    //@@begin others

    //@@end

    In closeWindow() method write

    if(objWindow!=null)

    {

    objWindow.destroy();

    objWindow=null;

    }

    On your button click just call these methods to open and close external windows like

    wdThis.wdget<CompController>().closeWindow();

    Regards

    LN

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 23, 2008 at 09:10 AM

    For closing the current window.

    have a look at this thread.

    Problem in window closing

    Cheers,

    Bala

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 24, 2008 at 06:26 AM

    Try this:

    Create an attribute value ( say name : POPWindow ) of type IWDWindow in context both master view and child view and bind them.

    While you create window, assign the window object to the context element

    IWDWindow window = ......;

    wdContext.currentContextElement().setPOPWindow( window);

    in the close button action of the child view, put this code

    wdContext.currentContextElement().getPOPWindow().destroyInstance();

    note: Don;t forget to map the POPWindow attributes of both views;

    Regards

    Vinod V

    Add comment
    10|10000 characters needed characters exceeded