Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Trusted Contributor
Posts: 202
Registered: ‎11-21-2010
My Device: 9700
My Carrier: Virgin Mobile

WebWorks App for PlayBook and onClose

How can I write an onclose function to prompt the user that they are sure they want to close the app when the swipe the app to the top or close the app on a playbook?  Is this possible?

 

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: WebWorks App for PlayBook and onClose

i don't think there will be a way for you to trap when someone is closing the app by using gestures on the device. we took a look at this earlier. the issue is that javascript is run asyncronous on close so the app will close before you get a chance to ask "are you sure"
Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Trusted Contributor
Posts: 202
Registered: ‎11-21-2010
My Device: 9700
My Carrier: Virgin Mobile

Re: WebWorks App for PlayBook and onClose

thanks. so how would you prompt the user to save any unsaved data on gesture close? can you do things like setdirty like the phones?
Developer
Posts: 39
Registered: ‎03-01-2011
My Device: PlayBook
My Carrier: AT&T

Re: WebWorks App for PlayBook and onClose

i haven't done it yet, but i'm sure you know programmatically when it is gestured into card view.  can you just save by default at that point?  you could have a setting for the user that allows auto-save or not when the app is moved to the background (either from an up gesture to card view or side gesture to change apps).  not sure what data you're saving, though.