cancel
Showing results for 
Search instead for 
Did you mean: 

how to perform some actions before close of application

Former Member
0 Kudos

hi every one,

i am setting application properties like expirationTime with some value... how to get these values in my coding....

my requirement is, when i am closing my application in the browser, i need to store the time application closed.....and where can i code this....

how to perform some actions before close of application...

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sunil,

You can retrieve the application properties in your code by:

IWDApplicationInfo application = wdComponentAPI.getApplication().getApplicationInfo();

String value = application.findInApplicationProperties("<property name>").getValue();

for eg: you can retrieve expiration time as:

application.findInApplicationProperties("sap.expirationTime").getValue();

But expiration time is the time after which the application expires and has nothing to do with the real time

About the application closing, as far as I know there is no event in webdynpro to capture the window closing event. So it depends on how the user closes the application. If he closes the application from within it using some button or link, then you can very well write the required code there. If he closes the browser directly, then I don't think you can handle that.

Hope this helps,

Best Regards,

Nibu.

Answers (2)

Answers (2)

Yashpal
Active Contributor
0 Kudos

Hi,

to perform some action before closing can be done in wdDoExit() method of controllers......

for accessing the applicaton properties here is the link....

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/39dcb1e5-0601-0010-51b2-c52...

for the time functionality u can get the time of server in the wdDoExit() method...

new Date(System.currentTimeMillis());

Regards,

yashpal

Former Member
0 Kudos

Hi Sunil,

If you have noticed, there's a method

wdDoExit()

in your view's implementation. That is where you should set the expiration time.

I think you will need to set some persistent application properties.

IWDApplicationPropertyInfo tim = wdComponentAPI.getApplication().getApplicationInfo().findInApplicationProperties("EXPIRATIONTIME");

if(tim != null)
   tim.setAttributeValue("EXPIRATIONTIME","<your value>");

Regards,

Satyajit.