cancel
Showing results for 
Search instead for 
Did you mean: 

How to catch the action of window closing?

former_member336373
Participant
0 Kudos

Anybody know how to catch the action of closing the browser window?

For example:

If I want to delete some certain files when the web dynpro application browser is closed (quit the app), where can I put the codes to define the action, which will take effects everytime the the running application window is closed.

Regards

Irene

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Irene,

Check out following link:

Here, i have described how to close the window. And how to catch action of window closing.

Regards,

Bhavik

Former Member
0 Kudos

Hi Irene,

Sorry for the reply.

I misunderstood your question.

Please ignore previous reply. It was for closing child window.

Use your Component controller's wdExit method to do whatever you want.

This method will call when you close your application.

Regards,

Bhavik

Message was edited by: Bhavik Devisha

former_member336373
Participant
0 Kudos

Thanks a lot Devisha.

I have tried to put my codes in the wdDoExit() method, but still doesn't work.

I find the app even doesn't go to that step.

Former Member
0 Kudos

Hi Irene,

Have you write your code in wdExit of component controller?

I have tried it. I have created one test file inside this method. And when i closed my application it has created that file.

Regards,

Bhavik

former_member336373
Participant
0 Kudos

Hi Bhavik

I found there's no wdExit in the component controller.

What can I do then?

Is that the version problem?

Former Member
0 Kudos

Dear Irene,

Exact Method name is wdDoExit().

Regards,

Bhavik

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Irene Chen

I think it's not necessary to catch the action if you need

> If I want to delete some certain files when the web

> dynpro application browser is closed (quit the app),

you can use wdDoExit() function put your code there and the code will run where you close your application

best regards

Evgeny

former_member336373
Participant
0 Kudos

Thanks Evgeny, but I have already tried this. I mean I put my code in the wdDoExit() method, however nothing happened...

Then, I decide to find some other ways which is just why this topic comes out.

arun_srinivasan
Contributor
0 Kudos

hi

First u create an instance for the window during creation

IWDWindowInfo win=wdComponentAPI.getComponentInfo().findInWindows("windowname");

<b>IWDWindow win_obj=wdComponentAPI.getWindowManage().createWindow(win,true);</b>

With this instance u can destroy the window. if ur using popup window u can destroy the popup window by passing this instance to popup

window through component controller

u can destroy the window by using this codes.

<b>IWDWindow cl=wdContext.currentContextElement().getRef();</b>//getref is instance of window of type IWDWindow

<b>cl.destroy();</b> //To destoy the window.

All the contents of the window will be destroyed if it is used.U cannot reterive any information after its is destroyed

u can define the code in any action(button)

regards,

Arun