cancel
Showing results for 
Search instead for 
Did you mean: 

Closing the window - web dynpro Java

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

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

Former Member
0 Kudos

For closing the current window.

have a look at this thread.

Cheers,

Bala

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Sudeep,

No it's not a popup.

I have a view that contens an interactive form and I want to close the view(the explorer) when user clicks on a button.

Do you have an idea on how to di it?

Thanks

Karim

Former Member
0 Kudos

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

Former Member
0 Kudos

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

{

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

}

Former Member
0 Kudos

Thanks Kanwalpreet ,

But I can't find method getWindowcontext() under wdContext.currentContextElement()

Are you sure?

Karim

Former Member
0 Kudos

It is the context variable that u have created for ur window, u have 2 get that context n then close the window using that

former_member197348
Active Contributor
0 Kudos

Hi Karim,

Check these threads

Regards,

Siva

Former Member
0 Kudos

Thanks u so much